PgSqlCommand Constructor(String,PgSqlConnection,PgSqlTransaction)
Initializes a new instance of the
PgSqlCommand class with the text of the query, a
PgSqlConnection object, and the
PgSqlTransaction.
The following example creates a
PgSqlCommand and sets some of its properties.
|
|---|
public void CreateCommand()
{
PgSqlConnection pgSqlConnection = new PgSqlConnection(
"host=server;database=test;user id=postgres;");
pgSqlConnection.Open();
PgSqlTransaction myTrans = pgSqlConnection.BeginTransaction();
string mySelectQuery = "SELECT * FROM Test.Dept";
PgSqlCommand pgSqlCommand = new PgSqlCommand(mySelectQuery, pgSqlConnection,myTrans);
pgSqlCommand.FetchSize = 100
} |
|
|---|
Public Sub CreateCommand()
Dim pgSqlConnection As New PgSqlConnection( _
"host=server;database=test;user id=postgres;")
pgSqlConnection.Open()
Dim myTrans As PgSqlTransaction = pgSqlConnection.BeginTransaction()
Dim mySelectQuery As String = _
"SELECT * FROM Test.Dept"
Dim pgSqlCommand As New PgSqlCommand(mySelectQuery, pgSqlConnection, myTrans)
pgSqlCommand.FetchSize = 100
End Sub |