SIGN UP MEMBER LOGIN:    
ARTICLE

Backup utility in .Net

Posted by Nikhil Kumar Articles | ADO.NET in C# April 03, 2009
This is a article named backup is used to create a backup of your data and can restore your deleted data also.
Reader Level:
Download Files:
 


BackUp Software
Namespaces... which u will indclude......
 
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Management.Common;

Coding which u will on the click event of connect button...
 private void btnConnect_Click(object sender, EventArgs e)
        {
            try
            {
                if (cmbsrv_name.SelectedItem != null && cmbsrv_name.SelectedItem.ToString() != "")
                {
                    ServerConnection srvcon = new ServerConnection(cmbsrv_name.SelectedItem.ToString());
                    srvcon.LoginSecure = false;
                    srvcon.Login = txtuserid.Text;
                    srvcon.Password = txtPassword.Text;
                    srv = new Server(srvcon);
                    foreach (Database db in srv.Databases)
                    {
                        cmbDatabase.Items.Add(db.Name);
                    }
                }
                else
                {
                    MessageBox.Show("Please select a server first", "Server Not Selected", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
If u are running sql by windows auth....
then remove login and password and type Integrated security = true;
 type this code on the click event of backup button after conneted to the sql...
and for full suppot please download this file...

Login to add your contents and source code to this article
share this article :
post comment
 

Good Evening, Sir

Thank you so much for your suggesstion sir, i will follow it ...

Nikhil

Posted by Nikhil Kumar Apr 14, 2009

Nikhil, Post all your small articles and tips as a blog in the blogs section. Click on the Blogs link on the header. Thanks, Mahesh

Posted by Mahesh Chand Apr 14, 2009
Team Foundation Server Hosting
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications. Visit DynamicPDF here
Become a Sponsor