Last post Apr 14, 2015 06:14 AM by Mikesdotnetting
Apr 14, 2015 05:36 AM|jagdipa|LINK
I have a visual studio solution with a website project and a class library project. The class library project is basically a data layer, with a database mdf and some c# code.
My problem is, how do I write the connection string in the website project to hook up to this class library database?
Apr 14, 2015 06:14 AM|Mikesdotnetting|LINK
The code in your class library should be designed to take a connection string either in constructors or as a parameter to suitable methods. For example, if your library has methods that create database connections, they should accept a string that represents
the connection string to be used. Then when you call a method from your web app, it passes the connection string to your data library.