1 //------------------------------------------------------------------------------
2 // <copyright file="RowUpdatingEventArgs.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 // <owner current="true" primary="true">[....]</owner>
6 // <owner current="true" primary="false">[....]</owner>
7 //------------------------------------------------------------------------------
9 namespace System.Data.Common {
15 public delegate void RowUpdatingEventHandler(object sender, RowUpdatingEventArgs e);
18 public class RowUpdatingEventArgs : System.EventArgs {
19 private IDbCommand _command;
20 private StatementType _statementType;
21 private DataTableMapping _tableMapping;
22 private Exception _errors;
24 private DataRow _dataRow;
25 private UpdateStatus _status; // UpdateStatus.Continue; /*0*/
27 public RowUpdatingEventArgs(DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping) {
28 ADP.CheckArgumentNull(dataRow, "dataRow");
29 ADP.CheckArgumentNull(tableMapping, "tableMapping");
30 switch(statementType) {
31 case StatementType.Select:
32 case StatementType.Insert:
33 case StatementType.Update:
34 case StatementType.Delete:
36 case StatementType.Batch:
37 throw ADP.NotSupportedStatementType(statementType, "RowUpdatingEventArgs");
39 throw ADP.InvalidStatementType(statementType);
42 _command = command; // maybe null
43 _statementType = statementType;
44 _tableMapping = tableMapping;
48 virtual protected IDbCommand BaseCommand {
57 public IDbCommand Command {
66 public Exception Errors {
81 public StatementType StatementType {
83 return _statementType;
87 public UpdateStatus Status {
93 case UpdateStatus.Continue:
94 case UpdateStatus.ErrorsOccurred:
95 case UpdateStatus.SkipCurrentRow:
96 case UpdateStatus.SkipAllRemainingRows:
100 throw ADP.InvalidUpdateStatus(value);
105 public DataTableMapping TableMapping {
107 return _tableMapping;