LINQ to SQL in ASP.NET - moving connection string from app.config to web.config
-
I'm using LINQ to SQL and putting the generated classes inside a separate assembly (not the website project), but it's all part of the same solution. When the tool generates the classes it places the connection string inside an app.config file in the project, but I'd rather have this connection string inside the web.config file for the website. I've been trying the figure out how to do this and have come across this inside the *.designer.cs file for the LINQ to SQL generated files...
public TopicDatabaseDataContext() : base(global::TMS.Library.Properties.Settings.Default.TopicMappingSystemConnectionString, mappingSource) { OnCreated(); }
Now I could replace global::TMS.Library.Properties blah blah with some code to access the connection string in the web.config instead, but since this code is auto generated by a tool, I don't really want to do it this way. Is there a better way?Dominic Pettifer Blog: www.dominicpettifer.co.uk