• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Common.RowUpdatedEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Data.Common.RowUpdatedEventArgs的典型用法代码示例。如果您正苦于以下问题:C# RowUpdatedEventArgs类的具体用法?C# RowUpdatedEventArgs怎么用?C# RowUpdatedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RowUpdatedEventArgs类属于System.Data.Common命名空间,在下文中一共展示了RowUpdatedEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OnRowUpdated

		protected abstract void OnRowUpdated (RowUpdatedEventArgs value);
开发者ID:carrie901,项目名称:mono,代码行数:1,代码来源:DbDataAdapter.cs


示例2: OnRowUpdated

    /// <summary>
    /// Raised by DbDataAdapter after a row is updated
    /// </summary>
    /// <param name="value">The event's specifics</param>
    protected override void OnRowUpdated(RowUpdatedEventArgs value)
    {
      EventHandler<RowUpdatedEventArgs> handler = base.Events[_updatedEventPH] as EventHandler<RowUpdatedEventArgs>;

      if (handler != null)
        handler(this, value);
    }
开发者ID:rohitlodha,项目名称:DenverDB,代码行数:11,代码来源:SQLiteDataAdapter.cs


示例3: OnRowUpdated

		/// <summary>
		/// Raises the RowUpdating event of Sqlite data provider.
		/// </summary>
		/// <param name="args">An RowUpdatingEventArgs that contains the event data.</param>
		protected override void OnRowUpdated (RowUpdatedEventArgs args)
		{
			if (RowUpdated != null)
				RowUpdated(this, args);
		}
开发者ID:z0rg1nc,项目名称:CsharpSqliteFork,代码行数:9,代码来源:SqliteDataAdapter.cs


示例4: OnRowUpdated

 /// <summary>
 /// Overridden. Raises the RowUpdated event.
 /// </summary>
 /// <param name="value">A MySqlRowUpdatedEventArgs that contains the event data. </param>
 override protected void OnRowUpdated(RowUpdatedEventArgs value)
 {
   if (RowUpdated != null)
     RowUpdated(this, (value as MySqlRowUpdatedEventArgs));
 }
开发者ID:rotmgkillroyx,项目名称:rotmg_svr_OLD,代码行数:9,代码来源:dataadapter.cs


示例5: OnRowUpdated

			protected override void OnRowUpdated (RowUpdatedEventArgs value)
			{
				throw new NotImplementedException ();
			}
开发者ID:EricHripko,项目名称:mono,代码行数:4,代码来源:DbDataAdapterTest.cs


示例6: OnRowUpdated

 protected override void OnRowUpdated(RowUpdatedEventArgs value)
 {
     CrmDataAdapterRowUpdatedEventHandler handler = (CrmDataAdapterRowUpdatedEventHandler)Events[EventRowUpdated];
     if ((null != handler) && (value is CrmDataAdapterRowUpdatedEventArgs))
     {
         handler(this, (CrmDataAdapterRowUpdatedEventArgs)value);
     }
 }
开发者ID:YOTOV-LIMITED,项目名称:CrmAdo,代码行数:8,代码来源:CrmDataAdaptor.cs


示例7: OnRowUpdated

        /// <summary>
        /// Raised by the underlying DbDataAdapter after a row has been
        //updated
        /// </summary>
        protected override void OnRowUpdated(RowUpdatedEventArgs value)
        {
            EventHandler<RowUpdatedEventArgs> handler =
					Events[EventRowUpdated]as
					EventHandler<RowUpdatedEventArgs>;
            if (handler != null)
                handler(this, (RowUpdatedEventArgs) value);
        }
开发者ID:kyriakosbrastianos,项目名称:virtuoso-opensource,代码行数:12,代码来源:VirtuosoDataAdapter.cs


示例8: OnRowUpdated

 virtual protected void OnRowUpdated(RowUpdatedEventArgs value) { // V1.0.3300
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:2,代码来源:DbDataAdapter.cs


示例9: OnRowUpdated

 override protected void OnRowUpdated(RowUpdatedEventArgs value) {
     SqlRowUpdatedEventHandler handler = (SqlRowUpdatedEventHandler) Events[EventRowUpdated];
     if ((null != handler) && (value is SqlRowUpdatedEventArgs)) {
         handler(this, (SqlRowUpdatedEventArgs) value);
     }
     base.OnRowUpdated(value);
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:7,代码来源:SqlDataAdapter.cs


示例10: OnRowUpdated

 protected override void OnRowUpdated(
 RowUpdatedEventArgs value)
 {
 }
开发者ID:karmamule,项目名称:ReconRunner,代码行数:4,代码来源:DataReaderAdapter.cs


示例11: OnRowUpdated

        // If it's an Insert we fetch the @@Identity value and stuff it in the proper column
        protected void OnRowUpdated(object sender, RowUpdatedEventArgs e)
        {
            try
            {
                if(e.Status == UpdateStatus.Continue && e.StatementType == StatementType.Insert)
                {
                    TransactionMgr txMgr = TransactionMgr.ThreadTransactionMgr();

                    string[] identityCols = this.GetAutoKeyColumns().Split(';');

                    SQLiteCommand cmd = new SQLiteCommand();

                    foreach(string col in identityCols)
                    {
                         cmd.CommandText = "SELECT last_insert_rowid()";

                        // We make sure we enlist in the ongoing transaction, otherwise, we
                        // would most likely deadlock
                        txMgr.Enlist(cmd, this);
                        object o = cmd.ExecuteScalar(); // Get the Identity Value
                        txMgr.DeEnlist(cmd, this);

                        if(o != null)
                        {
                            e.Row[col] = o;
                        }
                    }

                    e.Row.AcceptChanges();
                }
            }
            catch {}
        }
开发者ID:ivladyka,项目名称:Ekran,代码行数:34,代码来源:SQLiteEntity.cs


示例12: OnRowUpdated

 /// <summary>
 ///   Raises the RowUpdated event of a .NET Framework data provider.
 /// </summary>
 /// <param name="value"> A <see cref="T:System.Data.Common.RowUpdatedEventArgs" /> that contains the event data. </param>
 protected override void OnRowUpdated(RowUpdatedEventArgs value)
 {
   if (RowUpdated != null)
     RowUpdated(this, (value as CUBRIDRowUpdatedEventArgs));
 }
开发者ID:CUBRID,项目名称:cubrid-adonet,代码行数:9,代码来源:CUBRIDDataAdapter.cs


示例13: OnRowUpdated

		protected virtual void OnRowUpdated (RowUpdatedEventArgs value)
		{
			if (Events ["RowUpdated"] != null) {
				Delegate [] rowUpdatedList = Events ["RowUpdated"].GetInvocationList ();
				foreach (Delegate rowUpdated in rowUpdatedList) {
					MethodInfo rowUpdatedMethod = rowUpdated.Method;
					rowUpdatedMethod.Invoke (value, null);
				}
			}
		}
开发者ID:jamescourtney,项目名称:mono,代码行数:10,代码来源:DbDataAdapter.cs


示例14: dbDA_RowUpdated

        /// <summary>
        /// Pre-Condition:  
        /// Post-Condition: Child records will be persisted in the database, consistant with the primary key of the parent record.
        /// Description:    This method will synchronize the primary and foreign keys.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void dbDA_RowUpdated(object sender, RowUpdatedEventArgs e)
        {
            int intID = 0;
            if (_dbConn.State == ConnectionState.Closed) _dbConn.Open();

            //OleDbCommand dbCMD = new OleDbCommand("SELECT @@IDENTITY", _dbConn);
            SQLiteCommand dbCMD = new SQLiteCommand("SELECT last_insert_rowid()", _dbConn);
            if (e.StatementType == StatementType.Insert)
            {
                intID = int.Parse(dbCMD.ExecuteScalar().ToString());
                e.Row[0] = intID;
            }
        }
开发者ID:michaelheffernan,项目名称:toolkit,代码行数:20,代码来源:dbConnSQLite.cs


示例15: OnRowUpdated

		protected override void OnRowUpdated (RowUpdatedEventArgs value) 
		{
         		SybaseRowUpdatedEventHandler handler = (SybaseRowUpdatedEventHandler) Events[EventRowUpdated];
			if ((handler != null) && (value is SybaseRowUpdatedEventArgs))
            			handler(this, (SybaseRowUpdatedEventArgs) value);
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:6,代码来源:SybaseDataAdapter.cs


示例16: OnRowUpdated

 protected override void OnRowUpdated(RowUpdatedEventArgs value)
 {
     EventHandler<H2RowUpdatedEventArgs> handler = (EventHandler<H2RowUpdatedEventArgs>)Events[EventRowUpdated];
     if (null != handler)
     {
         handler(this, (H2RowUpdatedEventArgs)value);
     }
 }
开发者ID:fjnogueira,项目名称:h2sharp,代码行数:8,代码来源:H2DataAdapter.cs


示例17: OnRowUpdated

		protected override void OnRowUpdated(RowUpdatedEventArgs value) {
			if (this.RowUpdated != null) {
				this.RowUpdated(this, value as MySqlRowUpdatedEventArgs);
			}
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:5,代码来源:MySqlDataAdapter.cs


示例18: UpdateBatchExecute

        private void UpdateBatchExecute(BatchCommandInfo[] batchCommands, int commandCount, RowUpdatedEventArgs rowUpdatedEvent)
        {
            try
            {
                // the batch execution may succeed, partially succeed and throw an exception (or not), or totally fail
                int recordsAffected = ExecuteBatch();
                rowUpdatedEvent.AdapterInit(recordsAffected);
            }
            catch (DbException e)
            {
                // an exception was thrown be but some part of the batch may have been succesfull
                ADP.TraceExceptionForCapture(e);
                rowUpdatedEvent.Errors = e;
                rowUpdatedEvent.Status = UpdateStatus.ErrorsOccurred;
            }
            Data.MissingMappingAction missingMapping = UpdateMappingAction;
            Data.MissingSchemaAction missingSchema = UpdateSchemaAction;

            int checkRecordsAffected = 0;
            bool hasConcurrencyViolation = false;
            List<DataRow> rows = null;

            // walk through the batch to build the sum of recordsAffected
            //      determine possible indivdual messages per datarow
            //      determine possible concurrency violations per datarow
            //      map output parameters to the datarow
            for (int bc = 0; bc < commandCount; ++bc)
            {
                BatchCommandInfo batchCommand = batchCommands[bc];
                StatementType statementType = batchCommand._statementType;

                // default implementation always returns 1, derived classes must override
                // otherwise DbConcurrencyException will only be thrown if sum of all records in batch is 0
                int rowAffected;
                if (GetBatchedRecordsAffected(batchCommand._commandIdentifier, out rowAffected, out batchCommands[bc]._errors))
                {
                    batchCommands[bc]._recordsAffected = rowAffected;
                }

                if ((null == batchCommands[bc]._errors) && batchCommands[bc]._recordsAffected.HasValue)
                {
                    // determine possible concurrency violations per datarow
                    if ((StatementType.Update == statementType) || (StatementType.Delete == statementType))
                    {
                        checkRecordsAffected++;
                        if (0 == rowAffected)
                        {
                            if (null == rows)
                            {
                                rows = new List<DataRow>();
                            }
                            batchCommands[bc]._errors = ADP.UpdateConcurrencyViolation(batchCommands[bc]._statementType, 0, 1, new DataRow[] { rowUpdatedEvent.Rows[bc] });
                            hasConcurrencyViolation = true;
                            rows.Add(rowUpdatedEvent.Rows[bc]);
                        }
                    }

                    // map output parameters to the datarow
                    if (((StatementType.Insert == statementType) || (StatementType.Update == statementType))
                        && (0 != (UpdateRowSource.OutputParameters & batchCommand._updatedRowSource)) && (0 != rowAffected))
                    {
                        if (StatementType.Insert == statementType)
                        {
                            // AcceptChanges for 'added' rows so backend generated keys that are returned
                            // propagte into the datatable correctly.
                            rowUpdatedEvent.Rows[bc].AcceptChanges();
                        }

                        for (int i = 0; i < batchCommand._parameterCount; ++i)
                        {
                            IDataParameter parameter = GetBatchedParameter(batchCommand._commandIdentifier, i);
                            ParameterOutput(parameter, batchCommand._row, rowUpdatedEvent.TableMapping, missingMapping, missingSchema);
                        }
                    }
                }
            }

            if (null == rowUpdatedEvent.Errors)
            {
                // Only error if RecordsAffect == 0, not -1.  A value of -1 means no count was received from server,
                // do not error in that situation (means 'set nocount on' was executed on server).
                if (UpdateStatus.Continue == rowUpdatedEvent.Status)
                {
                    if ((0 < checkRecordsAffected) && ((0 == rowUpdatedEvent.RecordsAffected) || hasConcurrencyViolation))
                    {
                        // bug50526, an exception if no records affected and attempted an Update/Delete
                        Debug.Assert(null == rowUpdatedEvent.Errors, "Continue - but contains an exception");
                        DataRow[] rowsInError = (null != rows) ? rows.ToArray() : rowUpdatedEvent.Rows;
                        rowUpdatedEvent.Errors = ADP.UpdateConcurrencyViolation(StatementType.Batch, commandCount - rowsInError.Length, commandCount, rowsInError);
                        rowUpdatedEvent.Status = UpdateStatus.ErrorsOccurred;
                    }
                }
            }
        }
开发者ID:dotnet,项目名称:corefx,代码行数:94,代码来源:DbDataAdapter.cs


示例19: OnRowUpdated

 protected override void OnRowUpdated(RowUpdatedEventArgs value)
 {
     var handler = Events[updatedEventKey] as EventHandler<RowUpdatedEventArgs>;
     if (handler != null)
         handler(this, value);
 }
开发者ID:deveel,项目名称:deveeldb,代码行数:6,代码来源:DeveelDbDataAdapter.cs


示例20: UpdateRowExecute

        private void UpdateRowExecute(RowUpdatedEventArgs rowUpdatedEvent, IDbCommand dataCommand, StatementType cmdIndex)
        {
            Debug.Assert(null != rowUpdatedEvent, "null rowUpdatedEvent");
            Debug.Assert(null != dataCommand, "null dataCommand");
            Debug.Assert(rowUpdatedEvent.Command == dataCommand, "dataCommand differs from rowUpdatedEvent");

            bool insertAcceptChanges = true;
            UpdateRowSource updatedRowSource = dataCommand.UpdatedRowSource;
            if ((StatementType.Delete == cmdIndex) || (0 == (UpdateRowSource.FirstReturnedRecord & updatedRowSource)))
            {
                int recordsAffected = dataCommand.ExecuteNonQuery();
                rowUpdatedEvent.AdapterInit(recordsAffected);
            }
            else if ((StatementType.Insert == cmdIndex) || (StatementType.Update == cmdIndex))
            {
                // we only care about the first row of the first result
                using (IDataReader dataReader = dataCommand.ExecuteReader(CommandBehavior.SequentialAccess))
                {
                    DataReaderContainer readerHandler = DataReaderContainer.Create(dataReader, ReturnProviderSpecificTypes);
                    try
                    {
                        bool getData = false;
                        do
                        {
                            // advance to the first row returning result set
                            // determined by actually having columns in the result set
                            if (0 < readerHandler.FieldCount)
                            {
                                getData = true;
                                break;
                            }
                        } while (dataReader.NextResult());

                        if (getData && (0 != dataReader.RecordsAffected))
                        {
                            SchemaMapping mapping = new SchemaMapping(this, null, rowUpdatedEvent.Row.Table, readerHandler, false, SchemaType.Mapped, rowUpdatedEvent.TableMapping.SourceTable, true, null, null);

                            if ((null != mapping.DataTable) && (null != mapping.DataValues))
                            {
                                if (dataReader.Read())
                                {
                                    if ((StatementType.Insert == cmdIndex) && insertAcceptChanges)
                                    {
                                        rowUpdatedEvent.Row.AcceptChanges();
                                        insertAcceptChanges = false;
                                    }
                                    mapping.ApplyToDataRow(rowUpdatedEvent.Row);
                                }
                            }
                        }
                    }
                    finally
                    {
                        // using Close which can optimize its { while(dataReader.NextResult()); } loop
                        dataReader.Close();

                        // RecordsAffected is available after Close, but don't trust it after Dispose
                        int recordsAffected = dataReader.RecordsAffected;
                        rowUpdatedEvent.AdapterInit(recordsAffected);
                    }
                }
            }
            else
            {
                // StatementType.Select, StatementType.Batch
                Debug.Assert(false, "unexpected StatementType");
            }

            // map the parameter results to the dataSet
            if (((StatementType.Insert == cmdIndex) || (StatementType.Update == cmdIndex))
                && (0 != (UpdateRowSource.OutputParameters & updatedRowSource)) && (0 != rowUpdatedEvent.RecordsAffected))
            {
                if ((StatementType.Insert == cmdIndex) && insertAcceptChanges)
                {
                    rowUpdatedEvent.Row.AcceptChanges();
                }
                ParameterOutput(dataCommand.Parameters, rowUpdatedEvent.Row, rowUpdatedEvent.TableMapping);
            }

            // Only error if RecordsAffect == 0, not -1.  A value of -1 means no count was received from server,
            // do not error in that situation (means 'set nocount on' was executed on server).
            switch (rowUpdatedEvent.Status)
            {
                case UpdateStatus.Continue:
                    switch (cmdIndex)
                    {
                        case StatementType.Update:
                        case StatementType.Delete:
                            if (0 == rowUpdatedEvent.RecordsAffected)
                            {
                                Debug.Assert(null == rowUpdatedEvent.Errors, "Continue - but contains an exception");
                                rowUpdatedEvent.Errors = ADP.UpdateConcurrencyViolation(cmdIndex, rowUpdatedEvent.RecordsAffected, 1, new DataRow[] { rowUpdatedEvent.Row });
                                rowUpdatedEvent.Status = UpdateStatus.ErrorsOccurred;
                            }
                            break;
                    }
                    break;
            }
        }
开发者ID:dotnet,项目名称:corefx,代码行数:99,代码来源:DbDataAdapter.cs



注:本文中的System.Data.Common.RowUpdatedEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Common.RowUpdatingEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# Common.DbTransaction类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap