Move DB to DataDirectory

FreeriderUK

Well-known member
Joined
Jun 27, 2006
Messages
100
Location
London
Programming Experience
10+
Hi all,

does anyone know how I would move my database from the .\SQLEXPRESS directory to the Application Folder ?
 
Last edited:
It's simpler than I thought.

Just add DB to project using "add existing item"
Add "AttachDbFilename=|DataDirectory|\MyDB.mdf;" to app.config connectionstring.

It seems to work...
 
Data menu can be used to add new data source. You are asked if you want to add the file to project, if you confirm the connection string will point to "DataDirectory" by default.
 
Back
Top