Hello...
I know there are enough threads regarding this subject. But I didn't find any help with those. Thats why raising again over here..
Im having a very strange problem.. I just copied the source code from one working application to this new application. It was working fine over there but not over here in new application. Neither it was showing any error nor updating the data. Below is the source code (method) that im using ..
Can some body help in figure out the problem.Code:public static void AppendViolations(string dsPath, DataTable dtSource, string PartitionID) { string ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" + dsPath; string SqlStatement = "select * from IncaViolations"; OleDbConnection cn = new OleDbConnection(ConnectionString); OleDbCommand cmd = new OleDbCommand(SqlStatement, cn); OleDbDataAdapter da = new OleDbDataAdapter(cmd); da.AcceptChangesDuringFill = true; //no use even if i try false also OleDbCommandBuilder cmdbuild = new OleDbCommandBuilder(da); DataSet ds = new DataSet(); da.MissingSchemaAction = MissingSchemaAction.AddWithKey; da.Fill(ds, "IncaViolations"); foreach (DataRow dr in dtSource.Rows) { try { ds.Tables["IncaViolations"].ImportRow(dr); } catch (Exception ex) { ErrorLog = ErrorLog + ex.Message.ToString() + Environment.NewLine; CompleteLog = CompleteLog + ex.Message.ToString() + Environment.NewLine; } } da.InsertCommand = cmdbuild.GetInsertCommand(); da.UpdateCommand = cmdbuild.GetUpdateCommand(); da.DeleteCommand = cmdbuild.GetDeleteCommand(); try { int i=da.Update(ds, "IncaViolations"); System.Windows.Forms.MessageBox.Show(i.ToString()); CompleteLog = CompleteLog + "No Of Voilations Updated in " + PartitionID + " : " + ds.Tables["IncaViolations"].Rows.Count + Environment.NewLine; } catch (Exception ex1) { ErrorLog = ErrorLog + ex1.Message.ToString() + Environment.NewLine; CompleteLog = CompleteLog + ex1.Message.ToString() + Environment.NewLine; } // trans.Commit(); }
Thank you,
Srikanth.




The Difference between a Successful person and others is not a Lack of Knowledge,
Reply With Quote