MySqlCommand Constructor(String,MySqlConnection)
Initializes a new instance of the
MySqlCommand class with the text of the query and a
MySqlConnection object.
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;");
string mySelectQuery = "SELECT * FROM Test.Dept";
MySqlCommand mySqlCommand = new MySqlCommand(mySelectQuery, mySqlConnection);
mySqlCommand.FetchSize = 100;
} |
|
|---|
Public Sub CreateCommand()
Dim mySqlConnection As New MySqlConnection( _
"User Id=root;Host=localhost;Database=Test;")
Dim mySelectQuery As String = _
"SELECT * FROM Test.Dept"
Dim mySqlCommand As New MySqlCommand(mySelectQuery, mySqlConnection)
mySqlCommand.FetchSize = 100
End Sub |