Add(String,PgSqlType,Int32) Method
Adds a
PgSqlParameter to the
PgSqlParameterCollection given the the parameter name, data type, and data size.
The following example creates a
PgSqlParameterCollection, adds instances of
PgSqlParameter to the collection, and returns a reference to the new
PgSqlParameter.
public void CreatePgSqlParamColl(PgSqlConnection myConn) {
PgSqlCommand pgCommand = new PgSqlCommand("SELECT * FROM Test.Dept WHERE DeptNo = :DeptNo", myConn);
PgSqlParameterCollection myParamCollection = pgCommand.Parameters;
PgSqlParameter myNewParameter = myParamCollection.Add("DeptNo", PgSqlType.Int, 40);
}
Public Sub CreatePgSqlParamColl(myConn As PgSqlConnection)
Dim pgCommand As PgSqlCommand = New PgSqlCommand("SELECT * FROM Test.Dept WHERE DeptNo = :DeptNo", myConn)
Dim myParamCollection As PgSqlParameterCollection = pgCommand.Parameters
Dim myNewParameter As PgSqlParameter = myParamCollection.Add("DeptNo", PgSqlType.Int, 40)
End Sub