C# create new .dbml file problem
-
Saturday, July 07, 2012 12:11 AM
In a C# 2010 web form application, I created a new linq to sql (*.dbml) file. When this occurred, the .net framework created a default connection string. However I want the *.dml file to use the connection string I specify.
to solve this problem, I have the following questions:
1. When I do create a new .dbml file, how to I make the .net framework use the connection string I want to use and not come up with a default connection string?
2. For an existing .dbml file that I added to the application, how can I change the default connection string to the value I really want to be used?
All Replies
-
Saturday, July 07, 2012 3:41 PMModerator
The connection string is stored in the web.config file. Change it to whatever you want. Note however that the connection string you use for generating the model isn't necessarily the same as the one you'll use at runtime. At runtime the web.config contains the connection string.
Michael Taylor - 6/7/2012
http://msmvps.com/blogs/p3net
- Marked As Answer by wendy elizabeth Saturday, July 07, 2012 8:11 PM

