Location of database

xpertwinner

Member
Joined
Dec 26, 2008
Messages
24
Programming Experience
Beginner
I created a database inside Visual Basic and I now have a an slq express database in dataconnections. How do I know where the database file is? How can I for example use it in another project? Thanks in advance.
 
you can take a look at the connection string in the settings (if thats where you put it.. i.e. you followed a Microsoft tutorial)

If the string shows Data Source=|DataDirectory|\my.mdf
Then you'll find the DB in your solution folder; it is copied out alongside the app every time you start the app

If the string shows Data Source=c:\my\path\to\the\my.mdf
Then you'll find the DB in the named path

If the string shows Data Source=SQLEXPRESS;Initial Catalog=my
Then you'll find the DB linked to the running instance of sqlexpress on your machine. It will probably be in the sQLSX data folders but to use it in another project, just copy the whole connection string

Your Mileage May Vary
 

Latest posts

Back
Top