JBinC
Con JBinC ahorras cientos de horas y miles de líneas de código.
Descarga aquí el archivo Dll para tus proyectos.
Download JBin.dll Para poder descargarte JBin.dll debes estar suscrito.
Suscríbete por sólo 1,99 € y accede a todas las descargas y a la asistencia técnica para ayudarte a usar nuestras herramientas de ayuda al programador.

Documentación JBinC
Documentación de la librería para poder aprobechar al máximo su potencia.

Data Sql
Crea y restaura Backup de tus bases de datos SQL Server.
C# .Net

using JBin;
using JBinC;

public partial class Form1 : Form
{

	private DataBaseJbin dbj;

	private void Form1_Load(object sender, EventArgs e)
	{

		dbj = new DataBaseJbin();

		dbj.IsErrorAbort = false;

		dbj.OnDataBaseBeginBackup += OnDBBegin;
		dbj.OnDataBaseEndBackup += OnDBEnd;
		dbj.OnDataBaseBeginRestore += OnDBRestoreBegin;
		dbj.OnDataBaseEndRestore += OnDBRestoreEnd;
		dbj.OnTableBackupBegin += OnTableBackup;
		dbj.OnTableBackupEnd += OnTableBackupEnd;
		dbj.OnDataBaseFtpBegin += OnTableFtpBegin;
		dbj.OnDataBaseFtpEnd += OnTableFtpEnd;
		dbj.OnDataBaseError += OnDBError;
		dbj.OnDataBaseAbort += OnDataBaseAbort;

		dbj.conexionData = new ConexionData("myServer", "myDataBase", "myUser", "myPassword");

	}

	#region "BUTTONS"

	private void botonBackup_Click(object sender, EventArgs e)
	{

	    lblStatus.Text = "Connect to DB";
	    lblProgress.Text = "";
	    lblStatus.Refresh();
	    lblProgress.Refresh();
	    ProgressBar1.Value = 0;

	    dbj.conexionData = new ConexionData(txtServerSource.Text, txtDBSource.Text, txtUserSource.Text, txtPassSource.Text);
	    dbj.Backup(txtFileBuckup.Text);

	    dbj = null;
	    MessageBox.Show("The End");

	}

	private void botonRestoreLocal_Click(object sender, EventArgs e)
	{

	    lblStatus.Text = "Connect to DB";
	    lblProgress.Text = "";
	    lblStatus.Refresh();
	    lblProgress.Refresh();
	    ProgressBar1.Value = 0;

	    dbj.IsErrorAbort = false;
	    dbj.conexionData = new ConexionData(txtServerDestiny.Text, txtDBDestiny.Text, txtUserDestiny.Text, txtPassDestiny.Text);
	    dbj.RestoreBackup(txtFileBuckup.Text);

	    dbj = null;
	    MessageBox.Show("The End");

	}

	private void botonRestoreFtp_Click(object sender, EventArgs e)
	{

	    lblStatus.Text = "Connect to DB";
	    lblProgress.Text = "";
	    lblStatus.Refresh();
	    lblProgress.Refresh();
	    ProgressBar1.Value = 0;

	    dbj = new DataBaseJbin();
	    dbj.IsErrorAbort = false;

	    dbj.CredentialsFTP = new System.Net.NetworkCredential(txtFTPUser.Text, txtFTPPass.Text);
	    Uri fileFtp = new Uri(txtFtpBackup.Text);

	    dbj.conexionData = new ConexionData(txtServerDestiny.Text, txtDBDestiny.Text, txtUserDestiny.Text, txtPassDestiny.Text);
	    IONetReturnError res = dbj.RestoreBackup(fileFtp);

	    if (res.Ok)
	    {
	        MessageBox.Show("The End");
	    }
	    else
	    {
	        MessageBox.Show(res.Mensage);
	    }

	}

	private void botonSearchFile_Click(object sender, EventArgs e)
	{

	    OpenFileDialog OpenFile = new OpenFileDialog();
	    OpenFile.InitialDirectory = txtFileBuckup.Text;
	    OpenFile.Filter = "JBin files (*.jbin)|*.jbin";
	    OpenFile.CheckFileExists = false;

	    if (OpenFile.ShowDialog() == DialogResult.OK) {
	        txtFileBuckup.Text = OpenFile.FileName;
	    }

	}

	#endregion

	#region "EVENTS"

	private void OnDataBaseAbort(Object sender, EventArgs e)
	{
			lblStatus.Text = "Abort";
			lblProgress.Text = "";
			ProgressBar1.Value = 0;
			lblStatus.Refresh();
			lblProgress.Refresh();
	}

	private int tablesCount;
	private void OnDBBegin(Object sender, DataBaseJbinBackupBeginEventArgs e)
	{
			tablesCount = e.TablesCount;
			ProgressBar1.Maximum = tablesCount;
			ProgressBar1.Value = 0;
			lblStatus.Text = "Backup Begin: " + e.TimeBeginBackup.ToString();
			lblProgress.Text = "Total " + tablesCount + " tablas.";
			ProgressBar1.Value = 0;
			lblStatus.Refresh();
			lblProgress.Refresh();
	}

	private void OnDBEnd(Object sender, DataBaseJbinBackupEndEventArgs e)
	{
			ProgressBar1.Value = ProgressBar1.Maximum;
			lblStatus.Text = "Backup End: " + e.TimeEndBackup.ToString();
			lblProgress.Text = "";
			ProgressBar1.Value = 0;
			lblStatus.Refresh();
			lblProgress.Refresh();
	}

	private void OnDBRestoreBegin(Object sender, DataBaseJbinRestoreBeginEventArgs e)
	{
			tablesCount = e.TablesCount;
			ProgressBar1.Maximum = e.TablesCount;
			ProgressBar1.Value = 0;
			lblStatus.Text = "Restore DataBase Begind: " + e.TablesCount + " tables.";
			lblProgress.Text = "";
			ProgressBar1.Value = 0;
			lblStatus.Refresh();
			lblProgress.Refresh();
	}

	private void OnDBRestoreEnd(Object sender, DataBaseJbinRestoreEndEventArgs e)
	{
			ProgressBar1.Value = ProgressBar1.Maximum;
			lblStatus.Text = "Restore DataBase End " + e.TimeEndBackup.ToString();
			lblProgress.Text = "";
			ProgressBar1.Value = 0;
			lblStatus.Refresh();
			lblProgress.Refresh();
	}


	private void OnDBError(Object sender, DataBaseJbinErrorEventArgs e)
	{
			lblStatus.Text = "Error: " + e.exception.Message;
			lblProgress.Text = "";
			lblStatus.Refresh();
			lblProgress.Refresh();
	}


	private void OnTableBackup(Object sender, DataTableJbinBackupBeginEventArgs e)
	{
			lblStatus.Text = "Table " + (e.IndexTable + 1) + " of " + tablesCount + " tables.";
			lblProgress.Text = "Begin " + e.IndexTable + " - Backup table " + e.nameTable;
			ProgressBar1.Value = e.IndexTable;
			lblStatus.Refresh();
			lblProgress.Refresh();
	}

	private void OnTableBackupEnd(Object sender, DataTableJbinBackupEndEventArgs e)
	{
			lblStatus.Text = "Table " + (e.IndexTable + 1) + " of " + tablesCount + " tables.";
			lblProgress.Text = "End " + e.IndexTable + " - Backup table " + e.nameTable;
			lblStatus.Refresh();
			lblProgress.Refresh();
	}


	private void OnTableRestoreBegin(Object sender, DataTableJbinRestoreBeginEventArgs e)
	{
			lblStatus.Text = "Table " + (e.IndexTable + 1) + " of " + tablesCount + " tables.";
			lblProgress.Text = "Begin " + e.IndexTable + " - Restore table " + e.nameTable;
			ProgressBar1.Value = e.IndexTable;
			lblStatus.Refresh();
			lblProgress.Refresh();
	}

	private void OnTableRestoreEnd(Object sender, DataTableJbinRestoreEndEventArgs e)
	{
			lblStatus.Text = "Table " + (e.IndexTable + 1) + " of " + tablesCount + " tables.";
			lblProgress.Text = "End " + e.IndexTable + " - Restore table " + e.nameTable;
			lblStatus.Refresh();
			lblProgress.Refresh();
	}


	private void OnTableFtpBegin(Object sender, DataBaseFtpBeginEventArgs e)
	{
			lblStatus.Text = "Download file server: " + e.fileDownload.AbsoluteUri;
			lblProgress.Text = "Date: " + e.TimeBeginFtp.ToString();
			lblStatus.Refresh();
			lblProgress.Refresh();
	}

	private void OnTableFtpEnd(Object sender, DataBaseFtpEndEventArgs e)
	{
			lblStatus.Text = "Downloaded file server: " + e.fileDownloaded.AbsoluteUri;
			lblProgress.Text = "Date: " + e.TimeEndFtp.ToString();
			lblStatus.Refresh();
			lblProgress.Refresh();
	}

	#endregion

}
VB .Net

Imports JBin
Imports JBinC

	Private WithEvents dbj As DataBaseJbin
	Private CountTables As Integer

	Public Class Form1

	End Sub

#Region "BUTTONS"
    Private Sub botonBackup_Click(sender As Object, e As EventArgs) Handles botonBackup.Click

        lblStatus.Text = "Connect to DB"
        lblProgress.Text = ""
        lblStatus.Refresh()
        lblProgress.Refresh()
        ProgressBar1.Value = 0

        dbj = New DataBaseJbin()
        dbj.IsErrorAbort = False
        dbj.conexionData = New ConexionData(txtServerSource.Text, txtDBSource.Text, txtUserSource.Text, txtPassSource.Text)
        dbj.Backup(txtFileBuckup.Text)
        dbj = Nothing
        MsgBox("The End")

    End Sub

    Private Sub botonRestoreLocal_Click(sender As Object, e As EventArgs) Handles botonRestoreLocal.Click

        lblStatus.Text = "Connect to DB"
        lblProgress.Text = ""
        lblStatus.Refresh()
        lblProgress.Refresh()
        ProgressBar1.Value = 0

        dbj = New DataBaseJbin()
        dbj.IsErrorAbort = False
        dbj.conexionData = New ConexionData(txtServerDestiny.Text, txtDBDestiny.Text, txtUserDestiny.Text, txtPassDestiny.Text)
        dbj.RestoreBackup(txtFileBuckup.Text)
        dbj = Nothing
        MsgBox("The End")

    End Sub

    Private Sub botonRestoreFtp_Click(sender As Object, e As EventArgs) Handles botonRestoreFtp.Click

        lblStatus.Text = "Connect to DB"
        lblProgress.Text = ""
        lblStatus.Refresh()
        lblProgress.Refresh()
        ProgressBar1.Value = 0

        dbj = New DataBaseJbin()
        dbj.IsErrorAbort = False
        dbj.CredentialsFTP = New System.Net.NetworkCredential(txtFTPUser.Text, txtFTPPass.Text)
        Dim fileFtp As Uri = New Uri(txtFtpBackup.Text)

        dbj.conexionData = New ConexionData(txtServerDestiny.Text, txtDBDestiny.Text, txtUserDestiny.Text, txtPassDestiny.Text)
        Dim res As IONetReturnError = dbj.RestoreBackup(fileFtp)

        If res.Ok Then
            MsgBox("The End")
        Else
            MsgBox(res.Mensage)
        End If

    End Sub

    Private Sub botonSearchFile_Click(sender As Object, e As EventArgs) Handles botonSearchFile.Click

        Dim OpenFile As OpenFileDialog = New OpenFileDialog()
        OpenFile.InitialDirectory = txtFileBuckup.Text
        OpenFile.Filter = "JBin files (*.jbin)|*.jbin"
        OpenFile.CheckFileExists = False

        If OpenFile.ShowDialog() = DialogResult.OK Then
            txtFileBuckup.Text = OpenFile.FileName
        End If

    End Sub

    Private Sub botonExit_Click(sender As Object, e As EventArgs) Handles botonExit.Click
        End
    End Sub

#End Region

#Region "EVENTS"

    Private Sub dt_OnDataBaseAbort(sender As Object, e As EventArgs) Handles dbj.OnDataBaseAbort
        lblStatus.Text = "Abort"
        lblProgress.Text = ""
        ProgressBar1.Value = 0
        lblStatus.Refresh()
        lblProgress.Refresh()
    End Sub

    Private Sub dt_OnDataBaseBeginBackup(sender As Object, e As DataBaseJbinBackupBeginEventArgs) Handles dbj.OnDataBaseBeginBackup
        CountTables = e.TablesCount
        ProgressBar1.Maximum = CountTables
        lblStatus.Text = "Backup Begin: " & e.TimeBeginBackup.ToString()
        lblProgress.Text = "Total " & CountTables & " tablas."
        ProgressBar1.Value = 0
        lblStatus.Refresh()
        lblProgress.Refresh()
    End Sub

    Private Sub dt_OnDataBaseEndBackup(sender As Object, e As DataBaseJbinBackupEndEventArgs) Handles dbj.OnDataBaseEndBackup
        ProgressBar1.Value = 0
        lblStatus.Text = "Backup End: " & e.TimeEndBackup.ToString()
        lblProgress.Text = ""
        lblStatus.Refresh()
        lblProgress.Refresh()
    End Sub

    Private Sub dt_OnDataBaseBeginRestore(sender As Object, e As DataBaseJbinRestoreBeginEventArgs) Handles dbj.OnDataBaseBeginRestore
        CountTables = e.TablesCount
        ProgressBar1.Maximum = CountTables
        ProgressBar1.Value = 0
        lblStatus.Text = "Restore DataBase Begind: " & e.TablesCount & " tables."
        lblProgress.Text = ""
        lblStatus.Refresh()
        lblProgress.Refresh()
    End Sub

    Private Sub dt_OnDataBaseEndRestore(sender As Object, e As DataBaseJbinRestoreEndEventArgs) Handles dbj.OnDataBaseEndRestore
        ProgressBar1.Value = 0
        lblStatus.Text = "Restore DataBase End " & e.TimeEndBackup.ToString()
        lblProgress.Text = ""
        lblStatus.Refresh()
        lblProgress.Refresh()
    End Sub


    Private Sub dt_OnDataBaseError(sender As Object, e As DataBaseJbinErrorEventArgs) Handles dbj.OnDataBaseError
        lblStatus.Text = "Error: " & e.exception.Message
        lblProgress.Text = ""
        lblStatus.Refresh()
        lblProgress.Refresh()
    End Sub


    Private Sub dt_OnTableBackupBegin(sender As Object, e As DataTableJbinBackupBeginEventArgs) Handles dbj.OnTableBackupBegin
        lblStatus.Text = "Table " & (e.IndexTable + 1) & " of " & CountTables & " tables."
        lblProgress.Text = "Begin " & e.IndexTable & " - Backup table " & e.nameTable
        ProgressBar1.Value = e.IndexTable
        lblStatus.Refresh()
        lblProgress.Refresh()
    End Sub

    Private Sub dt_OnTableBackupEnd(sender As Object, e As DataTableJbinBackupEndEventArgs) Handles dbj.OnTableBackupEnd
        lblStatus.Text = "Table " & (e.IndexTable + 1) & " of " & CountTables & " tables."
        lblProgress.Text = "End " & e.IndexTable & " - Backup table " & e.nameTable
        lblStatus.Refresh()
        lblProgress.Refresh()
    End Sub


    Private Sub dt_OnTableRestoreBackupBegin(sender As Object, e As DataTableJbinRestoreBeginEventArgs) Handles dbj.OnTableRestoreBackupBegin
        lblStatus.Text = "Table " & (e.IndexTable + 1) & " of " & CountTables & " tables."
        lblProgress.Text = "Begin " & e.IndexTable & " - Restore table " & e.nameTable
        ProgressBar1.Value = e.IndexTable
        lblStatus.Refresh()
        lblProgress.Refresh()
    End Sub

    Private Sub dt_OnTableRestoreBackupEnd(sender As Object, e As DataTableJbinRestoreEndEventArgs) Handles dbj.OnTableRestoreBackupEnd
        lblStatus.Text = "Table " & (e.IndexTable + 1) & " of " & CountTables & " tables."
        lblProgress.Text = "End " & e.IndexTable & " - Restore table " & e.nameTable
        lblStatus.Refresh()
        lblProgress.Refresh()
    End Sub


    Private Sub dbj_OnDataBaseFtpBegin(sender As Object, e As DataBaseFtpBeginEventArgs) Handles dbj.OnDataBaseFtpBegin

        lblStatus.Text = "Download file server: " + e.fileDownload.AbsoluteUri
        lblProgress.Text = "Date: " + e.TimeBeginFtp.ToString()
        lblStatus.Refresh()
        lblProgress.Refresh()

    End Sub

    Private Sub dbj_OnDataBaseFtpEnd(sender As Object, e As DataBaseFtpEndEventArgs) Handles dbj.OnDataBaseFtpEnd

        lblStatus.Text = "Downloaded file server: " + e.fileDownloaded.AbsoluteUri
        lblProgress.Text = "Date: " + e.TimeEndFtp.ToString()
        lblStatus.Refresh()
        lblProgress.Refresh()

    End Sub

#End Region

End Class



Ejemplos
El código de muestra en dos proyectos de ejemplo en Visual Studio .Net.
Descarga proyecto de ejemplo en VB.Net aquí: Download Ejemplo VB.Net
Descarga proyecto de ejemplo en C# aquí: Download Ejemplo C#