本文整理汇总了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);
}
}
示例2: IncidentBoxRow
public IncidentBoxRow()
{
_state = DataRowState.Added;
_IsDefault = false;
_ControllerId = -1;
_ManagerId = -1;
}
示例3: VCardRow
public VCardRow()
{
_state = DataRowState.Added;
_Birthday = DateTime.MinValue;
_OrganizationId = -1;
}
示例4: SynchronizationMetadataRow
public SynchronizationMetadataRow()
{
_state = DataRowState.Added;
_Uri = null;
_Timestamp = null;
}
示例5: EMailRouterPop3BoxActivityRow
public EMailRouterPop3BoxActivityRow()
{
_state = DataRowState.Added;
_IsActive = false;
_TotalMessageCount = 0;
}
示例6: ProjectSpreadSheetDataRow
public ProjectSpreadSheetDataRow()
{
_state = DataRowState.Added;
_Index = 0;
_CellType = 1;
}
示例7: EMailMessageLogSettingsRow
public EMailMessageLogSettingsRow()
{
_state = DataRowState.Added;
_IsActive = false;
_Period = 7;
}
示例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;
}
示例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;
}
示例10: mcweb_ReportAceRow
public mcweb_ReportAceRow()
{
_state = DataRowState.Added;
_Role = null;
_PrincipalId = null;
_Allow = false;
}
示例11: EMailRouterPop3BoxRow
public EMailRouterPop3BoxRow()
{
_state = DataRowState.Added;
_Port = 110;
_IsInternal = false;
_InternalEMailAddress = null;
_UseSecureConnection = 0;
}
示例12: SmtpBoxRow
public SmtpBoxRow()
{
_state = DataRowState.Added;
_Port = 25;
_SecureConnection = 0;
_Authenticate = false;
_IsDefault = false;
_Checked = false;
}
示例13: SynchronizationReplicaRow
public SynchronizationReplicaRow()
{
_state = DataRowState.Added;
_PrincipalId = null;
_ReplicaKeyMap = null;
_CurrentKnowledge = null;
_ForgottenKnowledge = null;
_ConflictLog = null;
_TombstoneLog = null;
_LastDeletedItemsCleanupTime = null;
}
示例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;
}
示例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;
}