dotConnect for MySQL Documentation
Devart.Data.MySql Namespace / MySqlDump Class / Database Property
Example

In This Topic
    Database Property (MySqlDump)
    In This Topic
    Gets or sets database to dump data from.
    Syntax
    'Declaration
     
    Public Property Database As String
    public string Database {get; set;}

    Property Value

    Database to dump data from.
    Remarks
    When Backup is executed it tries to determine in what database the tables are located using property Database. If this property is empty, Database property of associated MySqlConnection is used. If this property is empty too Backup method raises exception.
    Example
    public void DumpIt(MySqlConnection myConnection)
    {
      myConnection.Open();
    
      MySqlDump mySqlDump = new MySqlDump();
    
      mySqlDump.Connection = myConnection;
      mySqlDump.Database = "Test";
      mySqlDump.Tables = "Dept;Emp";
    
      StreamWriter stream = new StreamWriter("d:\\tmp\\mydump.dmp");
      mySqlDump.Backup(stream);
      stream.Close();
    
      myConnection.Close();
      Console.WriteLine("Dumped.");
    }
    Public Sub DumpIt(ByVal myConnection As MySqlConnection)
      myConnection.Open()
      Dim mySqlDump As New MySqlDump
      mySqlDump.Connection = myConnection
      mySqlDump.Database = "Test"
      mySqlDump.Tables = "Dept;Emp"
      Dim stream As New StreamWriter("d:\tmp\mydump.dmp")
      mySqlDump.Backup(stream)
      stream.Close()
      myConnection.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