DB2Command Constructor(String,DB2Connection)
Initializes a new instance of the
DB2Command class with the text of the query and a %% 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 |