Click here to Skip to main content
15,898,888 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Dear All,

Now I want some detail about taking backup of sql database with table values.
I have database and that database contains more than 10 tables.
When I am closing my application, at that time, database is automatically backed up with table
values in c# windows application.
All replies are Welcome.

Thanks in Advance
Dhinesh Kumar.V
Posted
v2

1 solution

I am giving a tip,

Open sql server
Now right click your database -> task -> backup

in this window you can see 'script' button -> 'script action to new Query window'

you will get backup cmd like below

BACKUP DATABASE [DB_Name] TO  DISK = N'E:\abc.bak' WITH NOFORMAT, NOINIT,  NAME = N'DB_Name-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10


Now just use variables string in place of DB_Name & Path as per requirement

and execute like you execute simple sql commands in C#.net

Happy Coding!
:)
 
Share this answer
 

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