Click here to Skip to main content
15,906,816 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to attach a.mdf file through data connection in server explorer.

It gives a warning "you do not have permission to open this file"

my connection

    <add name="MyCon" connectionString="Data Source=my-pc\SQLSERVER;AttachDbFilename=D:\DL PROJECT\DL PROJECT\App_Data\a.mdf;Integrated Security=True;User Instance=True" />


But when I attach through Microsoft Sql server managment studio it get attached
Snesh Prajapati 26-Jun-14 1:19am    
try to run Visual Studio as Administrator by right clicking on its exe or link in start menu. Let me know if it works.

1 solution

Always open VISUAL STUDIO As a ADMINISTRATOR ....So that these kind of error will not happen.
Share this answer

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

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