Click here to Skip to main content
15,920,110 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
Please help me,
I need to create a simple web applicatiton to create the backup of the SqlServer database.

Thanx in advance.....
Posted

For future reference, you often will not get an answer to a question like this, that is what Google is for[^]. You will need to execute that SQL from your C# app - AFAIK this is the easiest way to achieve a database backup in the manner you mentioned.

Please have a decent look before asking questions like this. There are a myriad places that describe exactly how to do this.
 
Share this answer
 
you already got some perfect link in addition to above all answer you can also go there[^] and there[^] having same question with nice solutions.
 
Share this answer
 
v2
How about you try this code.

---------------------------
MSIL
 try
{
    File.Copy(Application.StartupPath +
              "\\DBName.mdb", Application.StartupPath +
              "\\Backup\\" + DateTime.Now.Day.ToString() +
              "_" + DateTime.Now.Month.ToString() +
              "_" + DateTime.Now.Year.ToString() +
              "_DBBackUp.mdb");
}
catch (Exception)
{

    MessageBox.Show("Database already existde for Current Day");
}
 
Share this answer
 
May this same would help you

SqlServer Backup/Restore Utility[^]

The given sample is Windows Application. You understand the concept and implement it in a web application.

Mark it as answer if it is helpful.
 
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