Add(String,UniDbType) Method
Adds a
UniParameter to the
UniParameterCollection given the parameter name and data type.
The following example creates a
UniParameterCollection, adds instances of
UniParameter to the collection, and returns a reference to the new
UniParameter.
public void CreateUniParamColl() {
UniCommand myCommand = new UniCommand("SELECT * FROM Test.Dept WHERE DeptNo = :DeptNo", myConn);
UniParameterCollection myParamCollection = myCommand.Parameters;
object myParm = new UniParameter("DeptNo", UniDbType.Integer);
int pIndex = myParamCollection.Add(myParm);
}
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 myParm As Object = New UniParameter("DeptNo", UniDbType.Integer)
Dim pIndex As Integer = myParamCollection.Add(myParm)
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