'Declaration Public Shadows Function CreateParameter() As SQLiteParameter
public new SQLiteParameter CreateParameter()
Return Value
A SQLiteParameter object.
'Declaration Public Shadows Function CreateParameter() As SQLiteParameter
public new SQLiteParameter CreateParameter()
Public void CreateParam(SQLiteConnection sqConnection) { SQLiteCommand sqCommand = new SQLiteCommand("SELECT * FROM Dept WHERE DeptNo=:Deptno",sqConnection); SQLiteParameter myParam = sqCommand.CreateParameter(); myParam.SQLiteType = Devart.Data.SQLite.SQLiteType.Int32; myParam.Value = 10; myParam.ParameterName = "Deptno"; sqCommand.Parameters.Add(myParam); sqConnection.Open(); SQLiteDataReader sqReader = null; try { sqReader = sqCommand.ExecuteReader(); while (sqReader.Read()) { Console.WriteLine(sqReader.GetInt32(0) + ", " + sqReader.GetString(1) + ", " + sqReader.GetString(2)); } } finally { sqReader.Close(); sqConnection.Close(); } }
Public Sub CreateParam(ByVal sqConnection As SQLiteConnection) Dim sqCommand As New SQLiteCommand("SELECT * FROM Dept WHERE DeptNo=:Deptno", sqConnection) Dim myParam As SQLiteParameter = sqCommand.CreateParameter() myParam.SQLiteType = Devart.Data.SQLite.SQLiteType.Int32 myParam.Value = 10 myParam.ParameterName = "Deptno" sqCommand.Parameters.Add(myParam) sqConnection.Open() Dim sqReader As SQLiteDataReader = Nothing Try sqReader = sqCommand.ExecuteReader() While sqReader.Read() Console.WriteLine(sqReader.GetInt32(0).ToString() + ", " _ + sqReader.GetString(1) + ", " _ + sqReader.GetString(2)) End While Finally sqReader.Close() sqConnection.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