Web.Config and Server.MapPath

  • Thread starter Thread starter Marcin
  • Start date Start date
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
 
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
 
Back
Top