ADO.NET對象的構造(7)_OleDbParameter(上)
2024-07-10 12:59:38
供稿:網友
 
oledbparameter 構造
n public sub new()
n public sub new(byval name as string,byval value as object)
n public sub new(byval name as string,byval datatype as oledbtype)
n public sub new(byval name as string,byval datatype as oledbtype,byval size as integer)
n public sub new(byval name as string,byval datatype as oledbtype,byval size as integer, byval srccolumn as string)
n public sub new(byval parametername as string,byval dbtype as oledbtype,byval size as integer,byval direction as parameterdirection,byval isnullable as boolean,byval precision as byte,byval scale as byte,byval srccolumn as string,byval srcversion as datarowversion, byval value as object)
 
參數
1. name 要映射的參數的名稱。 
2. value 新 oledbparameter 對象的值。
3. datatype oledbtype 值之一。 oledbtype 和 dbtype 是鏈接的。因此,設置 dbtype 會將 oledbtype 更改為支持 oledbtype。
4. size 參數的長度。 
5. srccolumn 源列的名稱。
6. srcversion datarowversion 值之一。
在 update 操作過程中由 updatecommand 用來確定參數值是設置為 current 還是 original。它允許更新主鍵。
oledbparameter對象的sourceversion屬性設置為 item 屬性使用的 datarow 的版本,或設置為 datarow 對象的 getchildrows 方法的版本。當使用 item 或 datarow 對象的 getchildrows 檢索在 datarow 中找到的值時,使用 datarowversion 值。
datarowversion 向您通知存在 datarow 的哪個版本。版本在以下情況下發生更改: 
n 在調用 datarow 對象的 beginedit 方法之后,如果更改該值,則 current 和 proposed 值變得可用。 
n 在調用 datarow 對象的 canceledit 方法之后,proposed 值將被刪除。 
n 在調用 datarow 對象的 endedit 方法之后,proposed 值變成 current 值。 
n 在調用 datarow 對象的 acceptchanges 方法之后,original 值變得與 current 值相同。 
n 在調用 datatable 對象的 acceptchanges 方法之后,original 值變得與 current 值相同。 
n 在調用 datarow 對象的 rejectchanges 之后,proposed 值將被丟棄,版本變成 current。 
成員名稱
 說明
 
current 
 該行中包含當前值。
 
default 
 是 datarowstate 對當前行的默認版本。對于 added、modified 或 current 的 datarowstate 值,默認版本是 current。對于 deleted 的 datarowstate,該版本是 original。對于 detached 的 datarowstate 值,該版本是 proposed。
 
original 
 該行中包含其原始值。
 
proposed 
 該行中包含建議值。
 
 
7. scale 要將 value 解析為的總小數位數。
8. precision 要將 value 解析為的小數點左右兩側的總位數。 
9. isnullable 如果字段的值可為空,則為 true;否則為 false。 
10. direction parameterdirection 值之一。
成員名稱
 說明
 
input 
 參數是輸入參數。
 
inputoutput 
 參數既能輸入,也能輸出。
 
output 
 參數是輸出參數。
 
returnvalue 
 參數表示諸如存儲過程、內置函數或用戶定義函數之類的操作的返回值。