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

In This Topic
    CommitCount Property
    In This Topic
    Gets or sets number of SQL statements to execute before issuing COMMIT when restoring data from a dump.
    Syntax
    'Declaration
     
    Public Property CommitCount As Integer
    public int CommitCount {get; set;}

    Property Value

    Number of SQL statements to execute before issuing COMMIT. The default value is 0.
    Remarks
    By default, Restore method does not issue neither START TRANSACTION nor COMMIT statements. If you set CommitCount to some value greater than 0 these SQL statements will be issued after specified number of executions of script statements.
    Example
    public void RestoreIt(MySqlConnection myConnection)
    {
      myConnection.Open();
    
      MySqlDump mySqlDump = new MySqlDump();
      mySqlDump.Connection = myConnection;
    
      mySqlDump.CommitCount = 3;
    
      StreamReader stream = new StreamReader("d:\\tmp\\mydump.dmp");
      mySqlDump.Restore(stream);
      stream.Close();
      myConnection.Close();
    
      Console.WriteLine("Restored.");
    }
    Public Sub RestoreIt(ByVal myConnection As MySqlConnection)
      Dim mySqlDump As New MySqlDump
      myConnection.Database = "Test"
      myConnection.Open()
      mySqlDump.Connection = myConnection
      mySqlDump.CommitCount = 3
      Dim stream As New StreamReader("d:\tmp\base.dump")
      mySqlDump.Restore(stream)
      stream.Close()
      myConnection.Close()
      Console.WriteLine("Restored.")
    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