dotConnect for MySQL Documentation
Devart.Data.MySql Namespace / MySqlDump Class / MySqlDump Constructor / MySqlDump Constructor()
Example

In This Topic
    MySqlDump Constructor()
    In This Topic
    Initializes a new instance of the MySqlDump class.
    Syntax
    'Declaration
     
    Public Function New()
    public MySqlDump()
    Remarks
    The base constructor initializes all fields to their default values.
    Example
    This sample shows how to use MySqlDump object to create a backup of two tables.
    public void DumpIt(MySqlConnection myConnection)
    {
      myConnection.Open();
      MySqlDump mySqlDump = new MySqlDump();
      mySqlDump.Connection = myConnection;
      myConnection.Database = "Test";
      mySqlDump.IncludeDrop = true;
      mySqlDump.Tables = "Dept;Emp";
      mySqlDump.Backup();
      StreamWriter stream = new StreamWriter("d:\\tmp\\mysqldump.dmp");
      stream.WriteLine(mySqlDump.DumpText);
      stream.Close();
      Console.WriteLine("Dumped.");
    }
    Public Sub DumpIt(ByVal myConnection As MySqlConnection)
      myConnection.Open()
      Dim mySqlDump As MySqlDump = New MySqlDump
      mySqlDump.Connection = myConnection
      myConnection.Database = "Test"
      mySqlDump.IncludeDrop = True
      mySqlDump.Tables = "Dept;Emp"
      mySqlDump.Backup()
      Dim stream As StreamWriter = New StreamWriter("d:\tmp\mysqldump.dmp")
      stream.WriteLine(mySqlDump.DumpText)
      stream.Close()
      Console.WriteLine("Dumped.")
    End Sub
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also