Connection String problem

W

William Gower

I have set up a Setting in my Web.Config file. In my data class, I call

strConnectionString = Configuration.AppSettings("MyConnectionString"). I
know that I need to do something with the Server.MapPath method but how do I
do that in my data access layer class?

<appSettings>

<add key="MyConnectionString" value="Provider=Microsoft.Jet.OLEDB.4.0;User
ID=;Password=;Data Source=\database\union.mdb"></add>

</appSettings>

<
 
K

Karl

Just put the full path to the mdb file in the web.config under Data Source..

<add key="MyConnectionString" value="Provider=Microsoft.Jet.OLEDB.4.0;User
ID=;Password=;Data Source=c:\inetpub\wwwroot\database\union.mdb"></add>

Karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,218
Latest member
JolieDenha

Latest Threads

Top