dotConnect Universal Documentation
Devart.Data.Universal Namespace / UniParameterCollection Class / Add Method / Add(String,UniDbType,Int32,String) Method
The name of the parameter.
One of the UniDbType values.
The width of the column.
The name of the source column.
Example

In This Topic
    Add(String,UniDbType,Int32,String) Method
    In This Topic
    Adds a UniParameter to the UniParameterCollection 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 UniDbType, _
       ByVal size As Integer, _
       ByVal sourceColumn As String _
    ) As UniParameter
    public UniParameter Add( 
       string parameterName,
       UniDbType dbType,
       int size,
       string sourceColumn
    )

    Parameters

    parameterName
    The name of the parameter.
    dbType
    One of the UniDbType values.
    size
    The width of the column.
    sourceColumn
    The name of the source column.

    Return Value

    The new UniParameter object.
    Example
    The following example creates a UniParameterCollection, adds instances of UniParameter to the collection, and returns a reference to the new UniParameter.
    public void CreateUniParamColl(UniConnection myConn) {
      UniCommand myCommand = new UniCommand("SELECT * FROM Test.Dept WHERE DeptNo = :DeptNo", myConn);
      UniParameterCollection myParamCollection = myCommand.Parameters;
      UniParameter myNewParameter = myParamCollection.Add("DeptNo", UniDbType.Integer, 40, "DeptNo");
    }
    Public Sub CreateUniParamColl(myConn As UniConnection)
      Dim myCommand As UniCommand = New UniCommand("SELECT * FROM Test.Dept WHERE DeptNo = :DeptNo", myConn)
      Dim myParamCollection As UniParameterCollection = myCommand.Parameters
      Dim myNewParameter As UniParameter = myParamCollection.Add("DeptNo", UniDbType.Integer, 40, "DeptNo")
    End Sub
    Requirements

    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

    See Also