DB2Command Constructor(String,DB2Connection)
Initializes a new instance of the
DB2Command class with the text of the query and a
DB2Connection object.
The following example creates a
DB2Command and sets some of its properties.
|
|---|
public void CreateCommand()
{
DB2Connection dB2Connection = new DB2Connection(
"user id=db2admin;server=db2;database=SAMPLE;");
string mySelectQuery = "SELECT * FROM Dept";
DB2Command dB2Command = new DB2Command(mySelectQuery, dB2Connection);
dB2Command.FetchSize = 100;
} |
|
|---|
Public Sub CreateCommand()
Dim dB2Connection As New DB2Connection( _
"user id=db2admin;server=db2;database=SAMPLE;")
Dim mySelectQuery As String = _
"SELECT * FROM Dept"
Dim dB2Command As New DB2Command(mySelectQuery, dB2Connection)
dB2Command.FetchSize = 100
End Sub |