Export (0) Print
Expand All

OdbcParameter.ParameterName Property

Gets or sets the name of the OdbcParameter.

Namespace:  System.Data.Odbc
Assembly:  System.Data (in System.Data.dll)

abstract ParameterName : string with get, set 
override ParameterName : string with get, set

Property Value

Type: System.String
The name of the OdbcParameter. The default is an empty string ("").

Implements

IDataParameter.ParameterName

Instead of named parameters, the ODBC .NET Provider uses positional parameters that are marked with a question mark (?) in the syntax of the command text. Parameter objects in the OdbcParameterCollection and the actual parameters accepted by the stored procedure or parameterized SQL statement correspond to each other based on the order in which the OdbcParameter objects are inserted into the collection instead of by parameter name. Parameter names can be supplied, but will be ignored during parameter object binding.

The following example assumes that the data source has a table name MyTable and a stored procedure named MyProc that is defined as:

CREATE TABLE MyTable (col1 int, col2 smallmoney, col3 decimal)
CREATE PROC MyProc (@p1 int, @p2 smallmoney, @p3 decimal) AS INSERT INTO MyTable VALUES (@p1, @p2, @p3)

The following example creates parameters and calls the MyProc stored procedure:

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft