Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi,

i have created school management application.
i have installed in client machine. it runs successfully.
how to take backup and restore database in client machine using c# application.
client machine has sql express installed.
database is in application path directory.


reply as soon as possible...
Posted
Updated 17-Jun-13 1:01am
v2
Comments
_Amy 17-Jun-13 7:01am    
It may be urgent for you, but not for us.
adriancs 25-Jun-13 13:04pm    
http://lmgtfy.com/?q=how+to+backup+sql+database

Hi,

Even you have database file path you can not directly make a copy of that. you need to stop SQL server service to do that. If your database is online or your service is running then you may not able to perform restore operation. Although backup will be done.

But i suggest you to perform backup/restore only when your database is offline or your service is not running. If you have only single database on that machine then there will not be any problem with stopping sql service. In other case you need to make your database offline.

If you search in google, you can easily find the query to change state of your database to offline.

Hope this information will help you.

Thanks
-Amit
 
Share this answer
 
 
Share this answer
 
hi this following links are useful to you.....
[^]
and

[^]
and
http://msdn.microsoft.com/en-us//library/ms187048.aspx[^]
 
Share this answer
 
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900