Click here to Skip to main content
15,892,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using SQL SERVER 2008 and MS Visual Studio 2008. I have created a database and some tables in the database. The tables are empty.
I created a Project in Web development and attempted to add the database into the App_Data folder.

After I navigated to the database mdf file and clicked on it I receive an "Access Denied" message and the add dialog disappears after I OK the Access Denied message.


Any suggestions on how to get around this problem?

I can connect to an Access .mdb file with no problem
Posted
Updated 15-Dec-11 0:38am
v3
Comments
Slacker007 15-Dec-11 6:43am    
Have you had success in the past with the same configuration for your SQL Server database. If not, make sure that you have it configured properly. There are lots of hits on Google for this...I just checked. Good luck.

1 solution

Error message might occur on a remote call. It may work locally fine. This is due to the fact that the remote connections are not enabled on the SQL Server surface Area configuration. To accomplish this, please follow below steps:

Make sure your database engine is configured to accept remote connections: • Start > All Programs > SQL Server 2008 > Configuration Tools > SQL Server Surface Area Configuration • Click on Surface Area Configuration for Services and Connections • Select the instance that is having a problem > Database Engine > Remote Connections • Enable local and remote connections • Restart instance

Alternatively, if you are using a named SQL Server instance, make sure you are using that instance name in your connection strings in your ASweb P.NET application • Usually the format needed to specify the database server is machinename\instancename • Check your connection string as well
 
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