Parameter.DbType 屬性

定義

取得或設定參數的資料庫型別。Gets or sets the database type of the parameter.

public:
 property System::Data::DbType DbType { System::Data::DbType get(); void set(System::Data::DbType value); };
public System.Data.DbType DbType { get; set; }
member this.DbType : System.Data.DbType with get, set
Public Property DbType As DbType

屬性值

DbType

Parameter 執行個體的資料庫型別。The database type of the Parameter instance. 預設值是 ObjectThe default value is Object.

例外狀況

已嘗試將此屬性設定為不屬於 DbType 列舉中的值。An attempt was made to set this property to a value that is not in the DbType enumeration.

備註

資料庫類型可以用來建立強型別參數,以便在您的 Web 應用程式與基礎程式碼之間正確地轉換值,或是從資料庫資料表轉換成值。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.

如果藉由設定屬性來變更參數的資料庫類型 DbType ,則 OnParameterChanged 會呼叫方法。If the database type of the parameter is changed by setting the DbType property, the OnParameterChanged method is called.

適用於