Export (0) Print
Expand All

SqlMetaData Constructor (String, SqlDbType, Byte, Byte)

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

Initializes a new instance of the SqlMetaData class with the specified column name, type, precision, and scale.

Namespace: Microsoft.SqlServer.Server
Assembly: System.Data (in system.data.dll)

public SqlMetaData (
	string name,
	SqlDbType dbType,
	byte precision,
	byte scale
)
public SqlMetaData (
	String name, 
	SqlDbType dbType, 
	byte precision, 
	byte scale
)
public function SqlMetaData (
	name : String, 
	dbType : SqlDbType, 
	precision : byte, 
	scale : byte
)

Parameters

name

The name of the parameter or column.

dbType

The SQL Server type of the parameter or column.

precision

The precision of the parameter or column.

scale

The scale of the parameter or column.

Exception typeCondition

ArgumentNullException

The Name is a null reference (Nothing in Visual Basic).

ArgumentException

A SqlDbType that is not allowed was passed to the constructor as dbType, or scale was greater than precision.

Only the following SqlDbType is allowed to be passed to the constructor as dbType: Decimal.

The following are the default values assigned to dbType, depending on the SqlDbType (the XmlSchemaCollectionDatabase, XmlSchemaCollectionName, XmlSchemaCollectionOwningSchema, and Type properties are set to a null reference (Nothing in Visual Basic)):

SqlDbType

Maximum length

Precision

Scale

Locale

Compare options

Decimal

9

18

0

0

None

Windows 98, Windows 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 .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:
© 2015 Microsoft