Esempio n. 1
0
 /// <summary>
 /// Initializes a new <see cref="MySqlBatch"/> object, setting the <see cref="Connection"/> and <see cref="Transaction"/> if specified.
 /// </summary>
 /// <param name="connection">(Optional) The <see cref="MySqlConnection"/> to use.</param>
 /// <param name="transaction">(Optional) The <see cref="MySqlTransaction"/> to use.</param>
 public MySqlBatch(MySqlConnection?connection = null, MySqlTransaction?transaction = null)
 {
     Connection    = connection;
     Transaction   = transaction;
     BatchCommands = new MySqlBatchCommandCollection();
     m_commandId   = ICancellableCommandExtensions.GetNextId();
 }
Esempio n. 2
0
 public MySqlCommand(string?commandText, MySqlConnection?connection, MySqlTransaction?transaction)
 {
     GC.SuppressFinalize(this);
     m_commandId   = ICancellableCommandExtensions.GetNextId();
     m_commandText = commandText ?? "";
     Connection    = connection;
     Transaction   = transaction;
     CommandType   = CommandType.Text;
 }