SqlParameter Constructor (String, SqlDbType, Int32, ParameterDirection, Byte, Byte, String, DataRowVersion, Boolean, Object, String, String, String)

SqlParameter Constructor (String, SqlDbType, Int32, ParameterDirection, Byte, Byte, String, DataRowVersion, Boolean, Object, String, String, String)

Note: This constructor is new in the .NET Framework version 2.0.

Initializes a new instance of the SqlParameter class that uses the parameter name, the type of the parameter, the length of the parameter the direction, the precision, the scale, the name of the source column, one of the DataRowVersion values, a Boolean for source column mapping, the value of the SqlParameter, the name of the database where the schema collection for this XML instance is located, the owning relational schema where the schema collection for this XML instance is located, and the name of the schema collection for this parameter.

Namespace: System.Data.SqlClient
Assembly: System.Data (in system.data.dll)

public SqlParameter (
	string parameterName,
	SqlDbType dbType,
	int size,
	ParameterDirection direction,
	byte precision,
	byte scale,
	string sourceColumn,
	DataRowVersion sourceVersion,
	bool sourceColumnNullMapping,
	Object value,
	string xmlSchemaCollectionDatabase,
	string xmlSchemaCollectionOwningSchema,
	string xmlSchemaCollectionName
)
public SqlParameter (
	String parameterName, 
	SqlDbType dbType, 
	int size, 
	ParameterDirection direction, 
	byte precision, 
	byte scale, 
	String sourceColumn, 
	DataRowVersion sourceVersion, 
	boolean sourceColumnNullMapping, 
	Object value, 
	String xmlSchemaCollectionDatabase, 
	String xmlSchemaCollectionOwningSchema, 
	String xmlSchemaCollectionName
)
public function SqlParameter (
	parameterName : String, 
	dbType : SqlDbType, 
	size : int, 
	direction : ParameterDirection, 
	precision : byte, 
	scale : byte, 
	sourceColumn : String, 
	sourceVersion : DataRowVersion, 
	sourceColumnNullMapping : boolean, 
	value : Object, 
	xmlSchemaCollectionDatabase : String, 
	xmlSchemaCollectionOwningSchema : String, 
	xmlSchemaCollectionName : String
)

Parameters

parameterName

The name of the parameter to map.

dbType

One of the SqlDbType values.

size

The length of the parameter.

direction

One of the ParameterDirection values.

precision

The total number of digits to the left and right of the decimal point to which Value is resolved.

scale

The total number of decimal places to which Value is resolved.

sourceColumn

The name of the source column.

sourceVersion

One of the DataRowVersion values.

sourceColumnNullMapping

true if the source column is nullable; false if it is not.

value

An Object that is the value of the SqlParameter.

xmlSchemaCollectionDatabase

The name of the database where the schema collection for this XML instance is located.

xmlSchemaCollectionOwningSchema

The owning relational schema where the schema collection for this XML instance is located.

xmlSchemaCollectionName

The name of the schema collection for this parameter.

The Size and Precision are inferred from the value of the dbType parameter if they are not explicitly set in the size and precision parameters.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

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

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2016 Microsoft