Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ RowUpdatingHandler()

void System.Data.Common.DbCommandBuilder.RowUpdatingHandler ( RowUpdatingEventArgs rowUpdatingEvent)
inlineprotected

Definition at line 1246 of file DbCommandBuilder.cs.

1247 {
1248 if (rowUpdatingEvent == null)
1249 {
1250 throw ADP.ArgumentNull("rowUpdatingEvent");
1251 }
1252 try
1253 {
1254 if (rowUpdatingEvent.Status != 0)
1255 {
1256 return;
1257 }
1258 StatementType statementType = rowUpdatingEvent.StatementType;
1259 DbCommand dbCommand = (DbCommand)rowUpdatingEvent.Command;
1260 if (dbCommand != null)
1261 {
1262 switch (statementType)
1263 {
1264 case StatementType.Select:
1265 return;
1266 case StatementType.Insert:
1267 dbCommand = InsertCommand;
1268 break;
1269 case StatementType.Update:
1270 dbCommand = UpdateCommand;
1271 break;
1272 case StatementType.Delete:
1273 dbCommand = DeleteCommand;
1274 break;
1275 default:
1276 throw ADP.InvalidStatementType(statementType);
1277 }
1278 if (dbCommand != rowUpdatingEvent.Command)
1279 {
1280 dbCommand = (DbCommand)rowUpdatingEvent.Command;
1281 if (dbCommand != null && dbCommand.Connection == null)
1282 {
1283 DbCommand dbCommand2 = DataAdapter?.SelectCommand;
1284 if (dbCommand2 != null)
1285 {
1286 dbCommand.Connection = dbCommand2.Connection;
1287 }
1288 }
1289 }
1290 else
1291 {
1292 dbCommand = null;
1293 }
1294 }
1295 if (dbCommand == null)
1296 {
1297 RowUpdatingHandlerBuilder(rowUpdatingEvent);
1298 }
1299 }
1300 catch (Exception ex) when (ADP.IsCatchableExceptionType(ex))
1301 {
1302 ADP.TraceExceptionForCapture(ex);
1303 rowUpdatingEvent.Status = UpdateStatus.ErrorsOccurred;
1304 rowUpdatingEvent.Errors = ex;
1305 }
1306 }
void RowUpdatingHandlerBuilder(RowUpdatingEventArgs rowUpdatingEvent)

References System.Data.Common.ADP.ArgumentNull(), System.Data.Common.RowUpdatingEventArgs.Command, System.Data.Common.DbCommand.Connection, System.Data.Common.DbCommandBuilder.DeleteCommand, System.Data.Common.DbCommandBuilder.InsertCommand, System.Data.Common.ADP.InvalidStatementType(), System.Data.Common.ADP.IsCatchableExceptionType(), System.Data.Common.DbCommandBuilder.RowUpdatingHandlerBuilder(), System.Data.Common.RowUpdatingEventArgs.StatementType, System.Data.Common.RowUpdatingEventArgs.Status, System.Data.Common.ADP.TraceExceptionForCapture(), and System.Data.Common.DbCommandBuilder.UpdateCommand.