dotConnect for MySQL Documentation
Devart.Common Namespace / DbDump Class / GenerateHeader Property
Example

In This Topic
    GenerateHeader Property
    In This Topic
    Determines whether to add comments into the dump text.
    Syntax
    'Declaration
     
    Public Property GenerateHeader As Boolean
    public bool GenerateHeader {get; set;}

    Property Value

    true, if comments should be added into dump text; otherwise, false. The default value is false.
    Remarks

    Setting this property to true makes the script more user-friendly. A fragment of output may look like this:

    -- dotConnect for MySQL version: 5.50.62

    -- MySQL server version: 5.1.42

    -- MySQL client version: 6.0.2

    -- Script date 05/01/2010 6:00:18 PM

    Example
    This sample demonstrates dumping of two tables (Dept and Emp). The script is written to a file after the operation is complete. The script text is made more readable.
    public void DumpIt(MySqlConnection myConnection)
    {
      myConnection.Open();
      MySqlDump mySqlDump = new MySqlDump();
      mySqlDump.Connection = myConnection;
      myConnection.Database = "Test";
      mySqlDump.GenerateHeader = true;
      mySqlDump.Tables = "Emp;Dept";
      mySqlDump.Backup();
      StreamWriter stream = new StreamWriter("d:\\tmp\\mysqldump.dmp");
      stream.WriteLine(mySqlDump.DumpText);
      stream.Close();
      Console.WriteLine("Dumped.");
      myConnection.Close();
    }
    Public Sub DumpIt(ByVal myConnection As MySqlConnection)
      myConnection.Open()
      Dim mySqlDump As MySqlDump = New MySqlDump
      mySqlDump.Connection = myConnection
      mySqlDump.GenerateHeader = True
      mySqlDump.Tables = "Emp;Dept"
      mySqlDump.Backup()
      Dim stream As StreamWriter = New StreamWriter("d:\tmp\mysqldump.dmp")
      stream.WriteLine(mySqlDump.DumpText)
      stream.Close()
      Console.WriteLine("Dumped.")
      myConnection.Close()
    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