C# new linq to sql file problem
-
In a C# 2010 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?
-
In a C# 2010 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?
Whenever you create instance of DataContext pass the connectionstring in the constructor. This way you will be able to bypass the default connectionstring.
http://www.exploresilverlight.com Cheers! Vinod
-
Whenever you create instance of DataContext pass the connectionstring in the constructor. This way you will be able to bypass the default connectionstring.
http://www.exploresilverlight.com Cheers! Vinod
-
TestDataContext dataContext = new TestDataContext("connectionstring");
http://www.exploresilverlight.com Cheers! Vinod