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?
C# create new linq to sql file problem
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Dehnert Stephen14 pointsPosted Jul 7, 2012, 8:27 AM EDT
I hope you have declared the connection string in your web.config file.
Edit your dbml file in such a way that always it takes the connection string credentials from the web.config file using System.WebConfiguration.AppSettings namespace
Thanks
Buy Lace
scampercat147 pointsPosted Jul 7, 2012, 12:32 PM EDT