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. Problem in BackUp

Problem in BackUp

Scheduled Pinned Locked Moved C#
databasesysadminhelp
4 Posts 3 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.
  • S Offline
    S Offline
    SajjadZare
    wrote on last edited by
    #1

    Hi to all, I write below code to create backup but it doesn't work

    ServerConnection connection = new ServerConnection(".");
    Server srv = new Server(connection);
    SaveFileDialog sfd = new SaveFileDialog();
    if (sfd.ShowDialog() == DialogResult.OK)
    {
    Backup bkpDatabase = new Backup();
    bkpDatabase.Action = BackupActionType.Database;
    bkpDatabase.Database = txtDBName.Text;//txtDBName contain Name of database
    BackupDeviceItem bkpDevice = new BackupDeviceItem(sfd.FileName, DeviceType.File);
    bkpDatabase.Devices.Add(bkpDevice);
    bkpDatabase.SqlBackup(srv);
    }//if

    M M 2 Replies Last reply
    0
    • S SajjadZare

      Hi to all, I write below code to create backup but it doesn't work

      ServerConnection connection = new ServerConnection(".");
      Server srv = new Server(connection);
      SaveFileDialog sfd = new SaveFileDialog();
      if (sfd.ShowDialog() == DialogResult.OK)
      {
      Backup bkpDatabase = new Backup();
      bkpDatabase.Action = BackupActionType.Database;
      bkpDatabase.Database = txtDBName.Text;//txtDBName contain Name of database
      BackupDeviceItem bkpDevice = new BackupDeviceItem(sfd.FileName, DeviceType.File);
      bkpDatabase.Devices.Add(bkpDevice);
      bkpDatabase.SqlBackup(srv);
      }//if

      M Offline
      M Offline
      Md Marufuzzaman
      wrote on last edited by
      #2

      I think you need to clarify with some more detail... your given code snippets is not enough to figure out what is wrong.

      Thanks Md. Marufuzzaman


      I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.

      S 1 Reply Last reply
      0
      • M Md Marufuzzaman

        I think you need to clarify with some more detail... your given code snippets is not enough to figure out what is wrong.

        Thanks Md. Marufuzzaman


        I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.

        S Offline
        S Offline
        SajjadZare
        wrote on last edited by
        #3

        [^]

        1 Reply Last reply
        0
        • S SajjadZare

          Hi to all, I write below code to create backup but it doesn't work

          ServerConnection connection = new ServerConnection(".");
          Server srv = new Server(connection);
          SaveFileDialog sfd = new SaveFileDialog();
          if (sfd.ShowDialog() == DialogResult.OK)
          {
          Backup bkpDatabase = new Backup();
          bkpDatabase.Action = BackupActionType.Database;
          bkpDatabase.Database = txtDBName.Text;//txtDBName contain Name of database
          BackupDeviceItem bkpDevice = new BackupDeviceItem(sfd.FileName, DeviceType.File);
          bkpDatabase.Devices.Add(bkpDevice);
          bkpDatabase.SqlBackup(srv);
          }//if

          M Offline
          M Offline
          Mycroft Holmes
          wrote on last edited by
          #4

          Better, but still needs some more. What is the error message and which line of code generates it. If you have no errors then you need to look into the event logs on the server to see if there are any messages from SQL Server.

          Never underestimate the power of human stupidity RAH

          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