Server.MapPath problems.

D

Daniel Groh

Hi, I'm trying to use the Server.MapPath in my ClassLibrary application, but I didn'get it...I tryed already the System.Web.HttpServerUtility...

OpenConn();
DataSet dsErrorSQL = new DataSet();
HttpServerUtility myPath = new HttpServerUtility();
dsErrorSQL.ReadXml(myPath.MapPath("XMLErrors.xml"));
and i have this error:

No overload for method 'HttpServerUtility' takes '0' arguments

Wich namespace should i import ?

Thank you folks!

Daniel
 
J

Joe Mayo

Hi Daniel,

It's static. Try Server.MapPath("XMLErrors.xml")

Joe
--
http://www.csharp-station.com
Hi, I'm trying to use the Server.MapPath in my ClassLibrary application, but I didn'get it...I tryed already the System.Web.HttpServerUtility...

OpenConn();
DataSet dsErrorSQL = new DataSet();
HttpServerUtility myPath = new HttpServerUtility();
dsErrorSQL.ReadXml(myPath.MapPath("XMLErrors.xml"));
and i have this error:

No overload for method 'HttpServerUtility' takes '0' arguments

Wich namespace should i import ?

Thank you folks!

Daniel
 

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