dotConnect for SQLite Documentation
Devart.Data.SQLite Namespace / SQLiteParameterCollection Class / Add Method / Add(String,SQLiteType,Int32,String) Method
The name of the parameter.
The maximum size, in bytes, of the data the parameter can contain.
The name of the source column.
Example

On this page
    Add(String,SQLiteType,Int32,String) Method
    On this page
    Adds a SQLiteParameter to the SQLiteParameterCollection given the parameter name, data type, column width, and source column name.
    Syntax
    'Declaration
     
    Public Overloads Function Add( _
       ByVal parameterName As String, _
       ByVal dbType As SQLiteType, _
       ByVal size As Integer, _
       ByVal sourceColumn As String _
    ) As SQLiteParameter

    Parameters

    parameterName
    The name of the parameter.
    dbType
    size
    The maximum size, in bytes, of the data the parameter can contain.
    sourceColumn
    The name of the source column.

    Return Value

    The new SQLiteParameter object.
    Example
    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
    See Also