Farouk,
I recommend setting a breakpoint in the OnRowDeleting() method and step through to make sure the DataRow you think you are deleting is actually the one being deleted:
>[DBConcurrencyException: Concurrency violation: the DeleteCommand affected 0 of the expected 1 records.]
> System.Data.Common.DbDataAdapter.UpdatedRowStatusErrors(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount) +1384340
> System.Data.Common.DbDataAdapter.UpdatedRowStatus(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount) +41
> System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping) +2032
> System.Data.Common.DbDataAdapter.UpdateFromDataTable(DataTable dataTable, DataTableMapping tableMapping) +40
> System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String srcTable) +183
> OakLeaf.MM.Main.Data.mmDataAccessSql.SaveDataSet(DataSet ds, String tableName, String primaryKeyName, Boolean retrieveAutoIncrementPK, IDbDataAdapter dbAdapter) +1974
> OakLeaf.MM.Main.Business.mmBusinessObject.Delete(DataRow dr) +548
> OakLeaf.MM.Main.Business.mmBusinessObject.Delete(DataSet ds, String tableName, Int32 row) +95
> OakLeaf.MM.Main.Business.mmBusinessObject.Delete(DataSet ds, Int32 row) +69
> Nationality.grdNationality_RowDeleting(Object sender, GridViewDeleteEventArgs e) in C:\DotNetProjs\MMNet\HRMS\HRMSUI\Nationality.aspx.vb:61
> System.Web.UI.WebControls.GridView.OnRowDeleting(GridViewDeleteEventArgs e) +133
Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com