Database Access

weckl

New Member
In building 3 tier web applications(Presentation, Business Logic, Data Access) using .NET what is the best way to handle access to a DB. I used to hardcode the connection string in the global.asa file and then would access that application variable from my asp pages, but now I cannot access the application variable from the Data Access Layer. Any suggestions in doing it in .NET.put the connection string in the Web.config file. I too have built a DataAccessLayer and this is the approach I took. Under the Configuration heading, add something like this:<BR><configuration><BR> <appSettings><BR> <add key="myConn" value=http://aspmessageboard.com/archive/index.php/"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:InetPubwwwRootPortfoliodbprojects.mdb;Per sist Security Info=False"/><BR> </appSettings><BR><BR>Then the value can be accessed from an aspx page or a VB class like this:<BR>dim strConn As String = ConfigurationSettings.AppSettings("myConn")thanx, it worked.
 
Back
Top