Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. sql server 2000 DataBase Backup

sql server 2000 DataBase Backup

Scheduled Pinned Locked Moved C#
csharpdatabasesql-servervisual-studiosysadmin
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    Yathish hatter
    wrote on last edited by
    #1

    Help me to take sql server 2000 database backup using VS.net 2008 using C# code.

    M S L 3 Replies Last reply
    0
    • Y Yathish hatter

      Help me to take sql server 2000 database backup using VS.net 2008 using C# code.

      M Offline
      M Offline
      Manas Bhardwaj
      wrote on last edited by
      #2

      0.33 seconds of google search gave me these [^]results

      Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

      1 Reply Last reply
      0
      • Y Yathish hatter

        Help me to take sql server 2000 database backup using VS.net 2008 using C# code.

        S Offline
        S Offline
        Satish Pai
        wrote on last edited by
        #3

        Hi This Code might help you. we have to create 2 textbox 1 of name - dbName textbox 2 of name - txtLocation private void button1_Click(object sender, EventArgs e) { SqlCommand cmm = new SqlCommand(); SqlConnection cn = new SqlConnection("server=.;database=" + dbName.Text + ";user=sa;password=tiger123"); cn.Open(); cmm.CommandText = "BACKUP DATABASE " + dbName.Text + " TO DISK = N'" + txtLocation.Text + "\\Intermidiate_backup_200905291809.bak' WITH NOFORMAT, NOINIT, NAME = N'Intermidiate_backup_20090529180939', SKIP, REWIND, NOUNLOAD, STATS = 10"; cmm.CommandType = CommandType.Text; cmm.Connection = cn; cmm.ExecuteNonQuery(); } Thanks & regards Satish Pai B

        1 Reply Last reply
        0
        • Y Yathish hatter

          Help me to take sql server 2000 database backup using VS.net 2008 using C# code.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          public static void BackupDatabase(string DataBaseName , string Backupfile , string Description )
          {
          SqlCmd = new SqlCommand("BACKUP DATABASE @DataBaseName TO DISK = @Backupfilepath WITH INIT , DESCRIPTION = @Description", SqlCon);
          SqlCmd.Parameters.AddWithValue("@DataBaseName", DataBaseName);
          SqlCmd.Parameters.AddWithValue("@Backupfilepath", Backupfile);
          SqlCmd.Parameters.AddWithValue("@Description", Description);
          SqlCmd.ExecuteNonQuery();

              }
          

          I know nothing , I know nothing ...

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups