Parameter.DbType Property

Definition

Gets or sets the database type of the parameter.

public System.Data.DbType DbType { get; set; }

Property Value

The database type of the Parameter instance. The default value is Object.

Exceptions

An attempt was made to set this property to a value that is not in the DbType enumeration.

Remarks

The database type can be used to create strongly typed parameters, so that values are converted correctly between your Web application and underlying code or values from database tables.

If the database type of the parameter is changed by setting the DbType property, the OnParameterChanged method is called.

Applies to

Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1