本文整理汇总了C#中System.Data.Common.RowUpdatingEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# RowUpdatingEventArgs类的具体用法?C# RowUpdatingEventArgs怎么用?C# RowUpdatingEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RowUpdatingEventArgs类属于System.Data.Common命名空间,在下文中一共展示了RowUpdatingEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnRowUpdating
protected virtual void OnRowUpdating (RowUpdatingEventArgs value)
{
if (Events ["RowUpdating"] != null) {
Delegate [] rowUpdatingList = Events ["RowUpdating"].GetInvocationList ();
foreach (Delegate rowUpdating in rowUpdatingList) {
MethodInfo rowUpdatingMethod = rowUpdating.Method;
rowUpdatingMethod.Invoke (value, null);
}
}
}
示例2: OnRowUpdating
/// <summary>
/// Raised by the underlying DbDataAdapter when a row is being updated
/// </summary>
/// <param name="value">The event's specifics</param>
protected override void OnRowUpdating(RowUpdatingEventArgs value)
{
EventHandler<RowUpdatingEventArgs> handler = base.Events[_updatingEventPH] as EventHandler<RowUpdatingEventArgs>;
if (handler != null)
handler(this, value);
}
示例3: OnRowUpdating
/// <summary>
/// Raises the RowUpdated event of a Sqlite data provider.
/// </summary>
/// <param name="args">A RowUpdatedEventArgs that contains the event data.</param>
protected override void OnRowUpdating (RowUpdatingEventArgs args)
{
if (RowUpdating != null)
RowUpdating(this, args);
}
示例4: OnRowUpdating
/// <summary>
/// Overridden. Raises the RowUpdating event.
/// </summary>
/// <param name="value">A MySqlRowUpdatingEventArgs that contains the event data.</param>
override protected void OnRowUpdating(RowUpdatingEventArgs value)
{
if (RowUpdating != null)
RowUpdating(this, (value as MySqlRowUpdatingEventArgs));
}
示例5: OnRowUpdating
protected override void OnRowUpdating (RowUpdatingEventArgs value)
{
throw new NotImplementedException ();
}
示例6: OnRowUpdating
protected override void OnRowUpdating(RowUpdatingEventArgs value)
{
var handler = Events[updatingEventKey] as EventHandler<RowUpdatingEventArgs>;
if (handler != null)
handler(this, value);
}
示例7: RowUpdatingHandler
private void RowUpdatingHandler (object sender, RowUpdatingEventArgs args)
{
if (args.Command != null)
return;
try {
switch (args.StatementType) {
case StatementType.Insert:
args.Command = GetInsertCommand ();
break;
case StatementType.Update:
args.Command = GetUpdateCommand ();
break;
case StatementType.Delete:
args.Command = GetDeleteCommand ();
break;
}
} catch (Exception e) {
args.Errors = e;
args.Status = UpdateStatus.ErrorsOccurred;
}
}
示例8: RowUpdatingHandler
protected void RowUpdatingHandler(RowUpdatingEventArgs rowUpdatingEvent) {
if (null == rowUpdatingEvent) {
throw ADP.ArgumentNull("rowUpdatingEvent");
}
try {
if (UpdateStatus.Continue == rowUpdatingEvent.Status) {
StatementType stmtType = rowUpdatingEvent.StatementType;
DbCommand command = (DbCommand)rowUpdatingEvent.Command;
if (null != command) {
switch(stmtType) {
case StatementType.Select:
Debug.Assert(false, "how did we get here?");
return; // don't mess with it
case StatementType.Insert:
command = InsertCommand;
break;
case StatementType.Update:
command = UpdateCommand;
break;
case StatementType.Delete:
command = DeleteCommand;
break;
default:
throw ADP.InvalidStatementType(stmtType);
}
if (command != rowUpdatingEvent.Command) {
command = (DbCommand)rowUpdatingEvent.Command;
if ((null != command) && (null == command.Connection)) { // MDAC 87649
DbDataAdapter adapter = DataAdapter;
DbCommand select = ((null != adapter) ? ((DbCommand)adapter.SelectCommand) : null);
if (null != select) {
command.Connection = (DbConnection)select.Connection;
}
}
// user command, not a command builder command
}
else command = null;
}
if (null == command) {
RowUpdatingHandlerBuilder(rowUpdatingEvent);
}
}
}
catch(Exception e) {
//
if (!ADP.IsCatchableExceptionType(e)) {
throw;
}
ADP.TraceExceptionForCapture(e);
rowUpdatingEvent.Status = UpdateStatus.ErrorsOccurred;
rowUpdatingEvent.Errors = e;
}
}
示例9: RowUpdatingHandlerBuilder
private void RowUpdatingHandlerBuilder(RowUpdatingEventArgs rowUpdatingEvent) {
// MDAC 58710 - unable to tell Update method that Event opened connection and Update needs to close when done
// HackFix - the Update method will close the connection if command was null and returned command.Connection is same as SelectCommand.Connection
DataRow datarow = rowUpdatingEvent.Row;
BuildCache(false, datarow, false);
DbCommand command;
switch(rowUpdatingEvent.StatementType) {
case StatementType.Insert:
command = BuildInsertCommand(rowUpdatingEvent.TableMapping, datarow);
break;
case StatementType.Update:
command = BuildUpdateCommand(rowUpdatingEvent.TableMapping, datarow);
break;
case StatementType.Delete:
command = BuildDeleteCommand(rowUpdatingEvent.TableMapping, datarow);
break;
#if DEBUG
case StatementType.Select:
Debug.Assert(false, "how did we get here?");
goto default;
#endif
default:
throw ADP.InvalidStatementType(rowUpdatingEvent.StatementType);
}
if (null == command) {
if (null != datarow) {
datarow.AcceptChanges();
}
rowUpdatingEvent.Status = UpdateStatus.SkipCurrentRow;
}
rowUpdatingEvent.Command = command;
}
示例10: RowUpdatingHandler
protected void RowUpdatingHandler(RowUpdatingEventArgs rowUpdatingEvent)
{
if (rowUpdatingEvent == null)
{
throw ADP.ArgumentNull("rowUpdatingEvent");
}
try
{
if (rowUpdatingEvent.Status == UpdateStatus.Continue)
{
StatementType statementType = rowUpdatingEvent.StatementType;
DbCommand insertCommand = (DbCommand) rowUpdatingEvent.Command;
if (insertCommand != null)
{
switch (statementType)
{
case StatementType.Select:
return;
case StatementType.Insert:
insertCommand = this.InsertCommand;
break;
case StatementType.Update:
insertCommand = this.UpdateCommand;
break;
case StatementType.Delete:
insertCommand = this.DeleteCommand;
break;
default:
throw ADP.InvalidStatementType(statementType);
}
if (insertCommand != rowUpdatingEvent.Command)
{
insertCommand = (DbCommand) rowUpdatingEvent.Command;
if ((insertCommand != null) && (insertCommand.Connection == null))
{
DbDataAdapter dataAdapter = this.DataAdapter;
DbCommand command2 = (dataAdapter != null) ? dataAdapter.SelectCommand : null;
if (command2 != null)
{
insertCommand.Connection = command2.Connection;
}
}
}
else
{
insertCommand = null;
}
}
if (insertCommand == null)
{
this.RowUpdatingHandlerBuilder(rowUpdatingEvent);
}
}
}
catch (Exception exception)
{
if (!ADP.IsCatchableExceptionType(exception))
{
throw;
}
ADP.TraceExceptionForCapture(exception);
rowUpdatingEvent.Status = UpdateStatus.ErrorsOccurred;
rowUpdatingEvent.Errors = exception;
}
}
示例11: RowUpdatingHandlerBuilder
private void RowUpdatingHandlerBuilder(RowUpdatingEventArgs rowUpdatingEvent)
{
DbCommand command;
DataRow dataRow = rowUpdatingEvent.Row;
this.BuildCache(false, dataRow, false);
switch (rowUpdatingEvent.StatementType)
{
case StatementType.Insert:
command = this.BuildInsertCommand(rowUpdatingEvent.TableMapping, dataRow);
break;
case StatementType.Update:
command = this.BuildUpdateCommand(rowUpdatingEvent.TableMapping, dataRow);
break;
case StatementType.Delete:
command = this.BuildDeleteCommand(rowUpdatingEvent.TableMapping, dataRow);
break;
default:
throw ADP.InvalidStatementType(rowUpdatingEvent.StatementType);
}
if (command == null)
{
if (dataRow != null)
{
dataRow.AcceptChanges();
}
rowUpdatingEvent.Status = UpdateStatus.SkipCurrentRow;
}
rowUpdatingEvent.Command = command;
}
示例12: OnRowUpdating
protected override void OnRowUpdating(
RowUpdatingEventArgs value)
{
}
示例13: RowUpdatingHandler
protected void RowUpdatingHandler (object sender, RowUpdatingEventArgs rowUpdatingEvent)
{
throw new NotImplementedException ();
}
示例14: OnRowUpdating
/// <summary>
/// Raises the RowUpdating event of a .NET Framework data provider.
/// </summary>
/// <param name="value"> An <see cref="T:System.Data.Common.RowUpdatingEventArgs" /> that contains the event data. </param>
protected override void OnRowUpdating(RowUpdatingEventArgs value)
{
if (RowUpdating != null)
RowUpdating(this, (value as CUBRIDRowUpdatingEventArgs));
}
示例15: OnRowUpdating
protected override void OnRowUpdating(RowUpdatingEventArgs value) {
if (this.RowUpdating != null) {
this.RowUpdating(this, value as MySqlRowUpdatingEventArgs);
}
}