G
Guest
Dear helpers,
I have a ADO.NET table which has about 4 columns and less than 5000 rows.
table.Fill(...)
// modify table
DataTable changedTable = table.GetChanges();
// if there are any changes, update the database
if (changedTable != null)
{
rowsAffected = adapter.Update(changedTable);
if (rowsAffected == changedTable.Rows.Count)
{
table.AcceptChanges();
table.Merge(changedTable);
}
}
when the code is called, it took ~ 20 secs to finish, which is unacceptably
slow.
And stepping through it i found that it was due to AcceptChanges().
I am using .NET 2.0.
Can anyone help me on this or suggest workarounds?
Thanks very much!
I have a ADO.NET table which has about 4 columns and less than 5000 rows.
table.Fill(...)
// modify table
DataTable changedTable = table.GetChanges();
// if there are any changes, update the database
if (changedTable != null)
{
rowsAffected = adapter.Update(changedTable);
if (rowsAffected == changedTable.Rows.Count)
{
table.AcceptChanges();
table.Merge(changedTable);
}
}
when the code is called, it took ~ 20 secs to finish, which is unacceptably
slow.
And stepping through it i found that it was due to AcceptChanges().
I am using .NET 2.0.
Can anyone help me on this or suggest workarounds?
Thanks very much!