SqlMetaData
Specifies and retrieves metadata information from parameters and columns of SqlDataRecord objects. This class cannot be inherited.
Gets the length of text, ntext, and image data types.
Gets the comparison rules used for the column or parameter.
Gets the data type of the column or parameter.
Indicates if the column in the table-valued parameter is unique.
Gets the locale ID of the column or parameter.
Gets the maximum length of the column or parameter.
Gets the name of the column or parameter.
Gets the precision of the column or parameter.
Gets the scale of the column or parameter.
Returns the sort order for a column.
Returns the ordinal of the sort column.
Gets the data type of the column or parameter.
Gets the common language runtime (CLR) type of a user-defined type (UDT).
Gets the three-part name of the user-defined type (UDT) or the SQL Server type represented by the instance.
Reports whether this column should use the default server value.
Gets the name of the database where the schema collection for this XML instance is located.
Gets the name of the schema collection for this XML instance.
Gets the owning relational schema where the schema collection for this XML instance is located.
Initializes a new instance of the SqlMetaData class with the specified column name and type.
public SqlMetaData(string name, SqlDbType dbType, bool useServerDefault, bool isUniqueKey, SortOrder columnSortOrder, int sortOrdinal)
Initializes a new instance of the SqlMetaData class with the specified column name, and default server. This form of the constructor supports table-valued parameters by allowing you to specify if the column is unique in the table-valued parameter, the sort order for the column, and the ordinal of the sort column.
Initializes a new instance of the SqlMetaData class with the specified column name, type, precision, and scale.
public SqlMetaData(string name, SqlDbType dbType, byte precision, byte scale, bool useServerDefault, bool isUniqueKey, SortOrder columnSortOrder, int sortOrdinal)
Initializes a new instance of the SqlMetaData class with the specified column name, type, precision, scale, and server default. This form of the constructor supports table-valued parameters by allowing you to specify if the column is unique in the table-valued parameter, the sort order for the column, and the ordinal of the sort column.
Initializes a new instance of the SqlMetaData class with the specified column name, type, and maximum length.
public SqlMetaData(string name, SqlDbType dbType, long maxLength, bool useServerDefault, bool isUniqueKey, SortOrder columnSortOrder, int sortOrdinal)
Initializes a new instance of the SqlMetaData class with the specified column name, type, maximum length, and server default. This form of the constructor supports table-valued parameters by allowing you to specify if the column is unique in the table-valued parameter, the sort order for the column, and the ordinal of the sort column.
public SqlMetaData(string name, SqlDbType dbType, long maxLength, byte precision, byte scale, long locale, SqlCompareOptions compareOptions, Type userDefinedType)
Initializes a new instance of the SqlMetaData class with the specified column name, type, maximum length, precision, scale, locale ID, compare options, and user-defined type (UDT).
public SqlMetaData(string name, SqlDbType dbType, long maxLength, byte precision, byte scale, long localeId, SqlCompareOptions compareOptions, Type userDefinedType, bool useServerDefault, bool isUniqueKey, SortOrder columnSortOrder, int sortOrdinal)
Initializes a new instance of the SqlMetaData class with the specified column name, type, maximum length, precision, scale, locale ID, compare options, and user-defined type (UDT). This form of the constructor supports table-valued parameters by allowing you to specify if the column is unique in the table-valued parameter, the sort order for the column, and the ordinal of the sort column.
public SqlMetaData(string name, SqlDbType dbType, long maxLength, long locale, SqlCompareOptions compareOptions)
Initializes a new instance of the SqlMetaData class with the specified column name, type, maximum length, locale, and compare options.
public SqlMetaData(string name, SqlDbType dbType, long maxLength, long locale, SqlCompareOptions compareOptions, bool useServerDefault, bool isUniqueKey, SortOrder columnSortOrder, int sortOrdinal)
Initializes a new instance of the SqlMetaData class with the specified column name, type, maximum length, locale, compare options, and server default. This form of the constructor supports table-valued parameters by allowing you to specify if the column is unique in the table-valued parameter, the sort order for the column, and the ordinal of the sort column.
public SqlMetaData(string name, SqlDbType dbType, string database, string owningSchema, string objectName)
Initializes a new instance of the SqlMetaData class with the specified column name, type, database name, owning schema, and object name.
public SqlMetaData(string name, SqlDbType dbType, string database, string owningSchema, string objectName, bool useServerDefault, bool isUniqueKey, SortOrder columnSortOrder, int sortOrdinal)
Initializes a new instance of the SqlMetaData class with the specified column name, database name, owning schema, object name, and default server. This form of the constructor supports table-valued parameters by allowing you to specify if the column is unique in the table-valued parameter, the sort order for the column, and the ordinal of the sort column.
Initializes a new instance of the SqlMetaData class with the specified column name, type, and user-defined type (UDT).
Initializes a new instance of the SqlMetaData class with the specified column name, user-defined type (UDT), and SQLServer type.
public SqlMetaData(string name, SqlDbType dbType, Type userDefinedType, string serverTypeName, bool useServerDefault, bool isUniqueKey, SortOrder columnSortOrder, int sortOrdinal)
Initializes a new instance of the SqlMetaData class with the specified column name, type, user-defined type, SQL Server type, and server default. This form of the constructor supports table-valued parameters by allowing you to specify if the column is unique in the table-valued parameter, the sort order for the column, and the ordinal of the sort column.
Infers the metadata from the specified object and returns it as a SqlMetaData instance.
Validates the specified Boolean value against the metadata, and adjusts the value if necessary.
Validates the specified Byte value against the metadata, and adjusts the value if necessary.
Validates the specified array of Byte values against the metadata, and adjusts the value if necessary.
Validates the specified Char value against the metadata, and adjusts the value if necessary.
Validates the specified array of Char values against the metadata, and adjusts the value if necessary.
Validates the specified SqlBinary value against the metadata, and adjusts the value if necessary.
Validates the specified SqlBoolean value against the metadata, and adjusts the value if necessary.
Validates the specified SqlByte value against the metadata, and adjusts the value if necessary.
Validates the specified SqlBytes value against the metadata, and adjusts the value if necessary.
Validates the specified SqlChars value against the metadata, and adjusts the value if necessary.
Validates the specified SqlDateTime value against the metadata, and adjusts the value if necessary.
Validates the specified SqlDecimal value against the metadata, and adjusts the value if necessary.
Validates the specified SqlDouble value against the metadata, and adjusts the value if necessary.
Validates the specified SqlGuid value against the metadata, and adjusts the value if necessary.
Validates the specified SqlInt16 value against the metadata, and adjusts the value if necessary.
Validates the specified SqlInt32 value against the metadata, and adjusts the value if necessary.
Validates the specified SqlInt64 value against the metadata, and adjusts the value if necessary.
Validates the specified SqlMoney value against the metadata, and adjusts the value if necessary.
Validates the specified SqlSingle value against the metadata, and adjusts the value if necessary.
Validates the specified SqlString value against the metadata, and adjusts the value if necessary.
Validates the specified SqlXml value against the metadata, and adjusts the value if necessary.
Validates the specified DateTime value against the metadata, and adjusts the value if necessary.
Validates the specified DateTimeOffset value against the metadata, and adjusts the value if necessary.
Validates the specified Decimal value against the metadata, and adjusts the value if necessary.
Validates the specified Double value against the metadata, and adjusts the value if necessary.
Validates the specified Guid value against the metadata, and adjusts the value if necessary.
Validates the specified Int16 value against the metadata, and adjusts the value if necessary.
Validates the specified Int32 value against the metadata, and adjusts the value if necessary.
Validates the specified Int64 value against the metadata, and adjusts the value if necessary.
Validates the specified Object value against the metadata, and adjusts the value if necessary.
Validates the specified Single value against the metadata, and adjusts the value if necessary.
Validates the specified String value against the metadata, and adjusts the value if necessary.
Validates the specified TimeSpan value against the metadata, and adjusts the value if necessary.