OdbcParameterCollection Class
.NET Framework 3.0
Represents a collection of parameters relevant to an OdbcCommand and their respective mappings to columns in a DataSet. This class cannot be inherited.
Namespace: System.Data.Odbc
Assembly: System.Data (in system.data.dll)
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 void CreateMyProc(OdbcConnection connection) { OdbcCommand command = connection.CreateCommand(); command.CommandText = "{ call MyProc(?,?,?) }"; OdbcParameter param = 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(); }
System.Object
System.MarshalByRefObject
System.Data.Common.DbParameterCollection
System.Data.Odbc.OdbcParameterCollection
System.MarshalByRefObject
System.Data.Common.DbParameterCollection
System.Data.Odbc.OdbcParameterCollection
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show: