Connection String in Web.Config

Discussion in 'Databases' started by frictionadd, Oct 12, 2003.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I'm having the same issues too.
     
  2. I'm trying to set up my connection string in my Web.config file.
    The issue I'm having is that I can't seem to find a "Data Source" value that works, and I obviously don't have access to the Server.MapPath function inside Web.config
     
  3. You could do this by putting a testpage online, only setting the text-property of a label to server.mappath("/db").
    If you then run the page, you have the server-mappath value for the database directory.

    server.mappath certainly doesn't work in your web.config file, since it is only a textfile, used for configuring your application. It is not processed like a regular .aspx-page.

    Eventually, your connectionstring will look like this (if your using Access):
    provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\web\MyDASPLogin\htdocs\db\MyDatabaseName.mdb

    Replace MyDASPLogin with your login for my.discountasp.net (i.e. the name of your account), and MyDatabaseName.mdb with the fysical filename of your access database.

    --
    Steurm
    www.steurm.net/steurm
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page