OdbcParameterCollection Class
Represents a collection of parameters relevant to an OdbcCommand and their respective mappings to columns in a DataSet. This class cannot be inherited.
Assembly: System.Data (in System.Data.dll)
The following example assumes that the data source has a table named MoneyTable and a stored procedure named MoneyProcedure, which are defined as follows:
CREATE TABLE MoneyTable (col1 int, col2 smallmoney, col3 decimal); CREATE PROC MoneyProcedure (@p1 int, @p2 smallmoney, @p3 decimal) AS INSERT INTO MyTable VALUES (@p1, @p2, @p3);
The example creates parameters and calls the MoneyProcedure stored procedure.
Public Sub CreateMyProc(ByVal connection As OdbcConnection) Dim command As OdbcCommand = connection.CreateCommand() Command.CommandText = "{ call MyProc(?,?,?) }" Dim param As New OdbcParameter() param.DbType = DbType.Int32 param.Value = 1 command.Parameters.Add(param) param = New OdbcParameter() param.DbType = DbType.Decimal param.Value = 1 command.Parameters.Add(param) param = New OdbcParameter() param.DbType = DbType.Decimal param.Value = 1 command.Parameters.Add(param) command.ExecuteNonQuery() End Sub
System.MarshalByRefObject
System.Data.Common.DbParameterCollection
System.Data.Odbc.OdbcParameterCollection
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.