concurrency violation the updatecommand affected 0 of the expected error
private void UpdateDatabases() { strAddResult =new StringBuilder (); try { DataTable dtsec= new DataTable () ; dtsec= mySymbolMastertable.GetChanges(); if (connList != null ) { for (int i = 0; i < connList.Count; i++) { string connectionName; string sqlString; DataTable dt = new DataTable (); connectionName = connList[i].ToString(); connectionString = System.Configuration.ConfigurationSettings .AppSettings[connectionName]; SqlConnection mySQLConnection = new SqlConnection (connectionString); if (connectionName == "SecMasterConnectionSec" ) { sqlString = "SELECT * FROM [SymbolMaster_Secondary]" ; } else { sqlString ="SELECT * FROM [SymbolMaster]" ; } SqlDataAdapter myDataAdapter = new SqlDataAdapter (sqlString, mySQLConnection); SqlCommandBuilder myCmdBuilder = new SqlCommandBuilder (myDataAdapter); dt = dtsec; // dt = mySymbolMastertable.GetChanges(); //Add Handler //myDataAdapter.RowUpdating += new SqlRowUpdatingEventHandler(myDataAdapter_RowUpdating); myDataAdapter.RowUpdated +=new SqlRowUpdatedEventHandler (myDataAdapter_RowUpdated); myDataAdapter.ContinueUpdateOnError =true ; //myDataAdapter.InsertCommand = myCmdBuilder.GetInsertCommand(); //myDataAdapter.UpdateCommand = myCmdBuilder.GetUpdateCommand(); myDataAdapter.Update(dt); //Add Handler // myDataAdapter.RowUpdating += new SqlRowUpdatingEventHandler(myDataAdapter_RowUpdating); myDataAdapter.RowUpdated +=new SqlRowUpdatedEventHandler (myDataAdapter_RowUpdated); myCmdBuilder =null ; myDataAdapter =null; mySQLConnection =null ; }} } catch (Exception ex) { ''Catching Exception }}
DataTable dtsec= new DataTable () ; dtsec= mySymbolMastertable.GetChanges();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)