}
}
}
+ // Remove from indexes
+ for (int i = 0; i < this.Count; i++)
+ this.table.DeleteRowFromIndexes (this [i]);
+
List.Clear ();
}
public DataRow Find (object key)
{
return Find(new object[]{key});
- }
+ }
/// <summary>
/// Gets the row containing the specified primary key values.
/// </summary>
- public DataRow Find (object[] keys)
+ public DataRow Find (object[] keys)
{
if (table.PrimaryKey.Length == 0)
throw new MissingPrimaryKeyException ("Table doesn't have a primary key.");
- if (keys == null)
+ if (keys == null)
throw new ArgumentException ("Expecting " + table.PrimaryKey.Length +" value(s) for the key being indexed, but received 0 value(s).");
Index index = table.GetIndex(table.PrimaryKey,null,DataViewRowState.None,null,false);
row.CheckNullConstraints();
int newRecord = (row.Proposed >= 0) ? row.Proposed : row.Current;
+ if (newRecord < 0)
+ return;
+
foreach(Index index in table.Indexes) {
index.Update(row,newRecord);
}