asp.net.ph

SqlParameter.DBType Property

System.Data.SqlClient Namespace   SqlParameter Class


Sets or retrieves the native data type of the parameter.

Syntax


Script SqlParameter.DBType [ = enumValue ]

Property Value


enumValue One of the DBType values.

The property is read/write with a default value of Variant.

Implements

IDataParameter.DbType

Exceptions


Exception Type Condition
ArgumentOutOfRangeException The property was not set to a valid DBType.

Remarks

Use the DBType property to specify or determine the native data type of a given parameter.

DbType and SqlDbType are linked. Setting the DbType changes the SqlDbType to a supported SqlDbType enum value.

Example

The following example initializes an SqlParameter and sets some of its properties.

public void CreateSqlParameter ( ) {
   SqlParameter myParam = new SqlParameter ( "@Description", DbType.VarChar, 100 );
   myParam.Direction = ParameterDirection.Output;
}
  C# VB

See Also

SqlParameter Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph