MySqlCommand Constructor(String,MySqlConnection,MySqlTransaction)
Initializes a new instance of the
MySqlCommand class with the text of the query, a
MySqlConnection object, and the
MySqlTransaction.
The following example creates a
MySqlCommand and sets some of its properties.
|
|---|
public void CreateCommand()
{
MySqlConnection mySqlConnection = new MySqlConnection(
"User Id=root;Host=localhost;Database=Test;");
mySqlConnection.Open();
MySqlTransaction myTrans = mySqlConnection.BeginTransaction();
string mySelectQuery = "SELECT * FROM Test.Dept";
MySqlCommand mySqlCommand = new MySqlCommand(mySelectQuery, mySqlConnection,myTrans);
mySqlCommand.FetchSize = 100
} |
|
|---|
Public Sub CreateCommand()
Dim mySqlConnection As New MySqlConnection( _
"User Id=root;Host=localhost;Database=Test;")
mySqlConnection.Open()
Dim myTrans As MySqlTransaction = mySqlConnection.BeginTransaction()
Dim mySelectQuery As String = _
"SELECT * FROM Test.Dept"
Dim mySqlCommand As New MySqlCommand(mySelectQuery, mySqlConnection, myTrans)
mySqlCommand.FetchSize = 100
End Sub |