F
Finn Stampe Mikkelsen
Hi
I'm in need of a way to copy my local sql database from the running project
to make a backup.
My connectionstring is like this:
"Data
Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\Database1.mdf;Integrated
Security=True;Connect Timeout=60;User Instance=True"
I get the error, that the file is in use and cannot be copied. I figure i
need to detatch the file and then copy the files, but i can't seem to find
any example of the code needed.
Could anybody here show me the code needed to detatch the database end
subsequently re-atatch it, so my application can continue running and using
it. I need to both be able to backup and restore the files, but don't know
how..
TIA
/Finn
--
Der er 10 slags mennesker - Dem som forstår binær og dem som ikke gør.
There are 10 kinds of people. Those who understand binary and those who
don't.
Es gibt 10 Arten von Menschen. Die, die Binär verstehen, bzw. die, die es
nicht tuhen.
I'm in need of a way to copy my local sql database from the running project
to make a backup.
My connectionstring is like this:
"Data
Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\Database1.mdf;Integrated
Security=True;Connect Timeout=60;User Instance=True"
I get the error, that the file is in use and cannot be copied. I figure i
need to detatch the file and then copy the files, but i can't seem to find
any example of the code needed.
Could anybody here show me the code needed to detatch the database end
subsequently re-atatch it, so my application can continue running and using
it. I need to both be able to backup and restore the files, but don't know
how..
TIA
/Finn
--
Der er 10 slags mennesker - Dem som forstår binær og dem som ikke gør.
There are 10 kinds of people. Those who understand binary and those who
don't.
Es gibt 10 Arten von Menschen. Die, die Binär verstehen, bzw. die, die es
nicht tuhen.