Click here to Skip to main content
14,297,645 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi,
I added an mdf to my project, opened table and some data to it.
Now I tried to make a typed dataset (to attach with my datagridview to display data)
It returns error:

you do not have permission to open this file
Contact the file owner or Administrator

What is that? Who is owner?

Thanks
Posted
Comments
Amir Mahfoozi 29-Jan-12 3:44am
   
"What is that? Who is owner?" I like your sense of humor ! :)
Member 10482044 22-Dec-13 12:25pm
   
I don't know what happened, but I no longer have admin priviliges on my laptop. HELP!! (please?)
Richard MacCutchan 29-Jan-12 3:50am
   
Well it's not anyone here.

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

It depends what you mean by "I added an mdf to my project" but it is not usual to include an MDF file in anything.

The problem you are having is that the file is locked and secured for exclusive use by the SQL server process. You could grant yourself permissions (or have the domain admin do this for you if you don't have priviliges to do this), but the chances are you shouldn't be trying to move the mdf file directly.

If you want to move the schema, Visual Studio professional and up has a database project. If you want to move the database you will be better off working with backup files.
   
Comments
Furqan Sehgal 29-Jan-12 6:26am
   
Thanks a lot. By adding I mean In Solution Explorer >> Add New Items >> Service-Based Database. Then I added table in Server Explorer.
So I should use backup files if i need to distribute them with my application?

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, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100