G
Guest
What's the alternative to the following?
void m_BindingSource_AddingNew(object sender, AddingNewEventArgs e)
{
MyTypedDataSet.TypedTableRow newRow = this.m_DataTable.NewTypedTableRow();
this.m_DataTable = new MyTypedDataSet.VendorsDataTable();
DataRow[] existingRows = this.m_DataTable.Select("ID < 0", "ID ASC");
if (existingRows.Length > 0) {
object lowestRowID = existingRows[0]["ID"];
newRow.ID = ((int)lowestRowID) - 1;
}
else {
newRow.ID = -1;
}
e.NewObject = newRow;
}
void m_BindingSource_AddingNew(object sender, AddingNewEventArgs e)
{
MyTypedDataSet.TypedTableRow newRow = this.m_DataTable.NewTypedTableRow();
this.m_DataTable = new MyTypedDataSet.VendorsDataTable();
DataRow[] existingRows = this.m_DataTable.Select("ID < 0", "ID ASC");
if (existingRows.Length > 0) {
object lowestRowID = existingRows[0]["ID"];
newRow.ID = ((int)lowestRowID) - 1;
}
else {
newRow.ID = -1;
}
e.NewObject = newRow;
}