I am working with a C#.net 2010 web form that uses linq to sql to connect to a sql server 2008 r2 database. In one of the connection strings in a linq to sql ( *.dbml) file, the connection string is set to is set to dbconnectionstring(settings). I want to change the connection string to dbConnectionString (Web.config), however where I am clicking on, will not let me change the connection string.
I have opened up the designer for the .dbml file and clicked properties. Where the connection string is setup, I can change that to a new connnection string.
If that is where I can the connection string, how do I get the visual studio ide to allow me to change the connection string to dbConnectionString (Web.config)?
Loading
Jignesh TrivediPosted Jul 8, 2012, 11:54 PM
It is good idea to store Connection string in App.config or web.config
Datacontext class of Linq toSql has also take connection string as a parameter.
Please refer
http://goneale.com/2009/03/26/untie-linq-to-sql-connection-string-from-application-settings/
http://msdn.microsoft.com/en-us/library/bb350721.aspx
hope this will help you.