If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Microsoft SQL Server > mobile database file

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-10-11, 17:01
canorous1 canorous1 is offline
Registered User
 
Join Date: Dec 2011
Posts: 1
Question mobile database file

Hi all,

I am finishing up some homework for an ASP.NET class and I am not sure how to proceed. First, all of the previous homework requiring database access has included a database file I downloaded from the class website. This was easy to move around, easy to include in a project, etc. This final project is a little different though. I had to make the database myself, include it in the project, and I have to find some way to upload it as part of the project. This last part is the part I am sticking on. I searched through the file system and found a .mdf file that matched the database I made. When I tried to use the "Add existing item" dialog to add the .mdf file to the project I was given an error that it could not be added access is denied. When I tried to copy and paste the .mdf file straight into the App_Data folder, it fails because the "file is open in SQL Server, close the file and try again."

How do I make my database that I created in SQL Server 2008 into a "mobile" database file like those I was able to just download from my class website?

Thanks,
Kevin

Edit: Oh my gosh! My wife was browsing through my textbook and found EXACTLY what I was looking for. All I had to do was detach the database. I had seen it as an option in SQL Server Management Studio, but I had no idea what exactly it did, so I didn't use it for fear of ruining my work.

Last edited by canorous1; 12-10-11 at 17:11. Reason: Found answer
Reply With Quote
  #2 (permalink)  
Old 12-10-11, 21:29
randirsa randirsa is offline
Registered User
 
Join Date: Nov 2011
Posts: 21
You can take just the backup of your databse and move it where you want annd restore.
Reply With Quote
  #3 (permalink)  
Old 12-11-11, 17:54
Eric the Red Eric the Red is offline
Registered User
 
Join Date: May 2008
Posts: 68
EDIT: Nevermind I did not read the topic completely!

Last edited by Eric the Red; 12-11-11 at 17:59.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On