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. Web Development
  3. ASP.NET
  4. back up sql data programmetically

back up sql data programmetically

Scheduled Pinned Locked Moved ASP.NET
csharpdatabasequestionasp-net
5 Posts 5 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.
  • B Offline
    B Offline
    billcodes
    wrote on last edited by
    #1

    hi, I am using sql database with asp.net in c#.I have a database application.HOw can i back up the data programmetically? regards Bill

    M R S V 4 Replies Last reply
    0
    • B billcodes

      hi, I am using sql database with asp.net in c#.I have a database application.HOw can i back up the data programmetically? regards Bill

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

      this should help[^]

      Manas Bhardwaj 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
      • B billcodes

        hi, I am using sql database with asp.net in c#.I have a database application.HOw can i back up the data programmetically? regards Bill

        R Offline
        R Offline
        r a m e s h
        wrote on last edited by
        #3

        Refer these links: SQL Server Database Backup Utility using VB.NET and SQL-DMO (New version)[^] http://www.aspfree.com/c/a/VB.NET/Simple-BackupRestore-Utility-With-SQLDMO-Using-VBNET/[^] http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_24262177.html[^]

        1 Reply Last reply
        0
        • B billcodes

          hi, I am using sql database with asp.net in c#.I have a database application.HOw can i back up the data programmetically? regards Bill

          S Offline
          S Offline
          Sabari MD
          wrote on last edited by
          #4

          backup database 'dbname' to disk='C:\...'

          Sabari MD Application Developer Veloxit Info Solutions

          1 Reply Last reply
          0
          • B billcodes

            hi, I am using sql database with asp.net in c#.I have a database application.HOw can i back up the data programmetically? regards Bill

            V Offline
            V Offline
            Vimalsoft Pty Ltd
            wrote on last edited by
            #5

            That is Simple

            set ANSI_NULLS ON
            set QUOTED_IDENTIFIER ON
            go

            -- backup a database
            ALTER PROCEDURE [dbo].[sp_BackupDatabase]

            @databasename varchar(32),
            @path varchar(256),
            @filename varchar(64)
            

            AS

            set nocount on

            declare @sql varchar(4000)

            select @sql = 'BACKUP DATABASE ' + ltrim(rtrim( @databasename ))
            select @sql = @sql + ' TO DISK = ''' + ltrim(rtrim(@path)) + ltrim(rtrim(@filename)) + ''' '
            select @sql = @sql + ' WITH INIT'
            --print @sql
            execute ( @sql )

            select 'Database successfully backed up!' [Result]

            Welcome :)

            Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.somee.com http://www.vuyiswamaseko.tiyaneProperties.co.za vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/

            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