Web.Config and Server.MapPath

M

Marcin

I am keeping my information about connection in web.config file. I would
like to use Server.MapPath method to retrive a path to a database in access
but I do not know how to do it. If I use just use + to combine string with
Server.MapPath method I got an error. I will appreciate if somebody can show
me the right way how to do it.
Thanks in advance
Marcin
 
N

Natty Gur

Hi,

You can’t use code inside web.config its text file not code. You can
save full db path or just the file name and use Request.ApplicationPath
to get the current application path where the mdb file exist.

Natty Gur[MVP]
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
 

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

Top