Add(String,SQLiteType,Int32,String) Method
Adds a
SQLiteParameter to the
SQLiteParameterCollection given the parameter name, data type, column width, and source column name.
The following example creates a
SQLiteParameterCollection, adds instances of
SQLiteParameter to the collection, and returns a reference to the new
SQLiteParameter.
public void CreateSQLiteParamColl(SQLiteConnection myConn) {
SQLiteCommand sqCommand = new SQLiteCommand("SELECT * FROM Dept WHERE DeptNo = :DeptNo", myConn);
SQLiteParameterCollection myParamCollection = sqCommand.Parameters;
SQLiteParameter myNewParameter = myParamCollection.Add("DeptNo", SQLiteType.Int32, 40, "DeptNo");
}
Public Sub CreateSQLiteParamColl(myConn As SQLiteConnection)
Dim sqCommand As SQLiteCommand = New SQLiteCommand("SELECT * FROM Dept WHERE DeptNo = :DeptNo", myConn)
Dim myParamCollection As SQLiteParameterCollection = sqCommand.Parameters
Dim myNewParameter As SQLiteParameter = myParamCollection.Add("DeptNo", SQLiteType.Int32, 40, "DeptNo")
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