Click here to Skip to main content
15,889,808 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to correct the connection string of access database, it says that server.mappath is not declared.
VB
Dim connectionString As String = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + Server.MapPath("database/counter.mdb")
Posted
Updated 15-Apr-10 0:19am
v2

Hi if it is classlibrary project then you need to add reference of System.Web. and use it as

HttpContext.Current.Server.MapPath


Hope this help.
 
Share this answer
 
Make sure that the service class inherits from System.Web.Services.Service.
Without this you don't have access to the Server object.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900