Category Archives: LINQ

Linq to SQL Database Connection String Issue

As i am moving in to hosting my application on an external server, i am finding some interesting and annoying (time consuming for research) things. i will try to address them as they come along…

One of the main thing was the way i handle my Data Layer. My Data Layer is a class library project and I have separate Business, Entity, and UI layers. My Data Layer is done using LINQ to SQL with stored procedures (All my interaction with Database are using Stored Procedures). When i dragged and dropped required tables and stored procedures in to the designer, behind the scenes, the DBML file, (specifically, the DataContext class) hasa default constructor that stores the connection string. To Re-iterate, we have this connection string defined in Web.Config, and app.Config (gets created for class library projects), and this hard coded value in “.dbml” File.

Continue reading Linq to SQL Database Connection String Issue