当前位置: 首页>>代码示例>>C#>>正文


C# DataRowState类代码示例

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


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

示例1: Insert

        public void Insert(DbConnection conn, string tableName, DataTable sourceData, Dictionary<string, string> columnMappings = null, DataRowState state = DataRowState.Added)
        {
            SqlConnection sqlConn = conn as SqlConnection;
            Check(conn);

            using (SqlBulkCopyWrapper sqlBC = new SqlBulkCopyWrapper(sqlConn))
            {
                sqlBC.BatchSize = 10000;
                sqlBC.BulkCopyTimeout = 600;
                sqlBC.DestinationTableName = tableName;
                if (columnMappings != null && columnMappings.Count > 0)
                {
                    foreach (var item in columnMappings)
                    {
                        sqlBC.ColumnMappings.Add(item.Value, item.Key);
                    }
                }
                else
                {
                    foreach (var item in sourceData.Columns.Cast<DataColumn>())
                    {
                        sqlBC.ColumnMappings.Add(item.ColumnName, item.ColumnName);
                    }

                }
                sqlBC.WriteToServer(sourceData, state);
            }
        }
开发者ID:piaolingzxh,项目名称:Justin,代码行数:28,代码来源:BulkCopySQL.cs

示例2: IncidentBoxRow

 public IncidentBoxRow()
 {
     _state = DataRowState.Added;
     _IsDefault = false;
     _ControllerId = -1;
     _ManagerId = -1;
 }
开发者ID:0anion0,项目名称:IBN,代码行数:7,代码来源:IncidentBoxRow.cs

示例3: VCardRow

        public VCardRow()
        {
            _state = DataRowState.Added;

            _Birthday = DateTime.MinValue;
            _OrganizationId = -1;
        }
开发者ID:0anion0,项目名称:IBN,代码行数:7,代码来源:VCardRow.cs

示例4: SynchronizationMetadataRow

        public SynchronizationMetadataRow()
        {
            _state = DataRowState.Added;

            _Uri = null;

            _Timestamp = null;
        }
开发者ID:0anion0,项目名称:IBN,代码行数:8,代码来源:SynchronizationMetadataRow1.cs

示例5: EMailRouterPop3BoxActivityRow

        public EMailRouterPop3BoxActivityRow()
        {
            _state = DataRowState.Added;

            _IsActive = false;

            _TotalMessageCount = 0;
        }
开发者ID:0anion0,项目名称:IBN,代码行数:8,代码来源:EMailRouterPop3BoxActivityRow.cs

示例6: ProjectSpreadSheetDataRow

        public ProjectSpreadSheetDataRow()
        {
            _state = DataRowState.Added;

            _Index = 0;

            _CellType = 1;
        }
开发者ID:0anion0,项目名称:IBN,代码行数:8,代码来源:ProjectSpreadSheetDataRow.cs

示例7: EMailMessageLogSettingsRow

        public EMailMessageLogSettingsRow()
        {
            _state = DataRowState.Added;

            _IsActive = false;

            _Period = 7;
        }
开发者ID:0anion0,项目名称:IBN,代码行数:8,代码来源:EMailMessageLogSettingsRow.cs

示例8: GeneratorCommand

        /// <summary>
        /// 
        /// </summary>
        /// <param name="connectionName"></param>
        /// <param name="dbTableName"></param>
        /// <param name="table"></param>
        /// <returns></returns>
        public static List<SqlCommandObject> GeneratorCommand(string connectionName, string dbTableName, DataTable table, DataRowState state)
        {
            if (connectionName.IsEmpty())
                throw new Exception("GeneratorCommand方法中的connectionName为空.");

            List<SqlCommandObject> cmds = new List<SqlCommandObject>();
            if (table.IsEmpty())
                return cmds;

            InsertCommandGenerator insertCommandGenerator = new InsertCommandGenerator();
            DeleteCommandGenerator deleteCommandGenerator = new DeleteCommandGenerator();
            UpdateCommandGenerator updateCommandGenerator = new UpdateCommandGenerator();

            SqlCommandObject cmd = null;
            if (table != null)
            {
                DataTable dtChanges = null;
                if (state == DataRowState.Unchanged)
                {
                    dtChanges = table.GetChanges();
                }
                else
                {
                    dtChanges = table.GetChanges(state);
                }

                if (dtChanges == null) return cmds;

                if (dbTableName.IsEmpty())
                    throw new Exception("GeneratorCommand方法中的tableName为空.");

                foreach (DataRow dr in dtChanges.Rows)
                {
                    switch (dr.RowState)
                    {
                        case DataRowState.Deleted:
                            cmd = deleteCommandGenerator.GenerateCommand(connectionName, dbTableName, dr);
                            break;
                        case DataRowState.Modified:
                            cmd = updateCommandGenerator.GenerateCommand(connectionName, dbTableName, dr);
                            break;
                        case DataRowState.Added:
                            cmd = insertCommandGenerator.GenerateCommand(connectionName, dbTableName, dr);
                            break;
                        default:
                            cmd = null;
                            break;
                    }
                    if (cmd != null)
                    {
                        cmds.Add(cmd);
                    }
                }
            }
            return cmds;
        }
开发者ID:JodenSoft,项目名称:JodenSoft,代码行数:63,代码来源:SqlCommandObjectGenerator.cs

示例9: Entity

        /// <summary>
        /// Overloaded constructor.
        /// </summary>
        /// <param name="key">An <see cref="System.Object"/> that 
        /// represents the primary identifier value for the 
        /// class.</param>
        protected Entity(Guid key)
        {
            _keyID = key;
            if (_keyID == Guid.Empty)
            {
                _keyID = Entity.NewKey();
            }

            _state = DataRowState.Unchanged;
        }
开发者ID:ramiroreal,项目名称:GestorFacturas,代码行数:16,代码来源:Entity.cs

示例10: mcweb_ReportAceRow

        public mcweb_ReportAceRow()
        {
            _state = DataRowState.Added;

            _Role = null;

            _PrincipalId = null;

            _Allow = false;
        }
开发者ID:0anion0,项目名称:IBN,代码行数:10,代码来源:mcweb_ReportAceRow.cs

示例11: EMailRouterPop3BoxRow

        public EMailRouterPop3BoxRow()
        {
            _state = DataRowState.Added;

            _Port = 110;

            _IsInternal = false;

            _InternalEMailAddress = null;

            _UseSecureConnection = 0;
        }
开发者ID:0anion0,项目名称:IBN,代码行数:12,代码来源:EMailRouterPop3BoxRow.cs

示例12: SmtpBoxRow

        public SmtpBoxRow()
        {
            _state = DataRowState.Added;

            _Port = 25;

            _SecureConnection = 0;

            _Authenticate = false;

            _IsDefault = false;

            _Checked = false;
        }
开发者ID:0anion0,项目名称:IBN,代码行数:14,代码来源:SmtpBoxRow.cs

示例13: SynchronizationReplicaRow

        public SynchronizationReplicaRow()
        {
            _state = DataRowState.Added;

            _PrincipalId = null;

            _ReplicaKeyMap = null;

            _CurrentKnowledge = null;

            _ForgottenKnowledge = null;

            _ConflictLog = null;

            _TombstoneLog = null;

            _LastDeletedItemsCleanupTime = null;
        }
开发者ID:0anion0,项目名称:IBN,代码行数:18,代码来源:SynchronizationReplicaRow.cs

示例14: EnumRow

		public bool EnumRow(DataRowState RowState)
		{
			if (OnRowEnumed != null)
			{
				foreach (DataRow row in dt.Rows)
				{
					OnRowEnumed(row);
				}
				if (dt != null && dt.Rows.Count > 0)
				{
					return true;
				}
				else
				{
					return false;
				}
			}
			return false;
		}
开发者ID:mind0n,项目名称:hive,代码行数:19,代码来源:TableEntity.cs

示例15: ucImageCollection

        public ucImageCollection(StateCollection aIC)
        {
            pStatusBarText = string.Empty;

            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            _pnl = new Panel();
            _nav = new ucMoveNavigator();
            _txt = new TextBox();

            _nav.Location = new System.Drawing.Point(0, this.Height-_nav.Height);
            _txt.Location = new System.Drawing.Point(_nav.Width+10, _nav.Top);
            _txt.Width = Width - _txt.Left-10;
            _txt.BackColor = SystemColors.Control;
            _txt.TextAlign = HorizontalAlignment.Center;
            _pnl.Location = new System.Drawing.Point(5, 5);
            _pnl.Size = new System.Drawing.Size(this.Width-10, _nav.Top-10);

            _pnl.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
            _nav.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
            _txt.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;

            Controls.AddRange(new Control [] {_pnl, _nav, _txt});

            _pnl.Paint += new PaintEventHandler(_pnl_Paint);
            _nav.MoveNavigator += new EvH_MoveNavigator(_nav_MoveNavigator);
            _txt.TextChanged += new EventHandler(_txt_TextChanged);

            _nav.pMinValue = 1;
            pImageCollection = aIC;

            _isFill = true;
            _curImg = null;
            _curState = DataRowState.Unchanged;

            ResizeRedraw = true;

            _tw = new Twain();
            _tw.Init( this.Handle );
            _msgfilter = false;
        }
开发者ID:infobook,项目名称:Tools4,代码行数:42,代码来源:ucImageCollection.cs


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