'Declaration Public Shadows Function CreateParameter() As PgSqlParameter
public new PgSqlParameter CreateParameter()
Return Value
A PgSqlParameter object.
'Declaration Public Shadows Function CreateParameter() As PgSqlParameter
public new PgSqlParameter CreateParameter()
Public void CreateParam(PgSqlConnection pgConnection) { PgSqlCommand pgCommand = new PgSqlCommand("SELECT * FROM Test.Dept WHERE DeptNo=:Deptno",pgConnection); PgSqlParameter myParam = pgCommand.CreateParameter(); myParam.PgSqlType = Devart.Data.PostgreSql.PgSqlType.Int; myParam.Value = 10; myParam.ParameterName = "Deptno"; pgCommand.Parameters.Add(myParam); pgConnection.Open(); PgSqlDataReader pgReader = null; try { pgReader = pgCommand.ExecuteReader(); while (pgReader.Read()) { Console.WriteLine(pgReader.GetInt32(0) + ", " + pgReader.GetString(1) + ", " + pgReader.GetString(2)); } } finally { pgReader.Close(); pgConnection.Close(); } }
Public Sub CreateParam(ByVal pgConnection As PgSqlConnection) Dim pgCommand As New PgSqlCommand("SELECT * FROM Test.Dept WHERE DeptNo=:Deptno", pgConnection) Dim myParam As PgSqlParameter = pgCommand.CreateParameter() myParam.PgSqlType = Devart.Data.PostgreSql.PgSqlType.Int myParam.Value = 10 myParam.ParameterName = "Deptno" pgCommand.Parameters.Add(myParam) pgConnection.Open() Dim pgReader As PgSqlDataReader = Nothing Try pgReader = pgCommand.ExecuteReader() While pgReader.Read() Console.WriteLine(pgReader.GetInt32(0).ToString() + ", " _ + pgReader.GetString(1) + ", " _ + pgReader.GetString(2)) End While Finally pgReader.Close() pgConnection.Close() End Try End Sub
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2