語言

SqlDataSourceStatusEventArgs.AffectedRows 屬性

定義

取得資料庫操作影響的列數。

public:
 property int AffectedRows { int get(); };
public int AffectedRows { get; }
member this.AffectedRows : int
Public ReadOnly Property AffectedRows As Integer

屬性值

資料庫操作所影響的列數。 預設值為 -1。

備註

所有操作都會回傳受影響的列數。 屬性AffectedRows的值與 、 Update及Insert方法的Delete回傳值相同。

當 Select 呼叫該方法且資料來源設為 DataReader 模式時,回傳值在所有情況下皆為 0。

適用於

另請參閱