private void btnSave_Click(object sender, EventArgs e) { if (this.rtbNotes.Text.Length > 0) { DataRow row = this.dsPolicyNotes.Tables[0].NewRow(); row["PolID"] = this.PolID; row["Note"] = this.rtbNotes.Text; row["edate"] = DateTime.Now; row.EndEdit(); this.dsPolicyNotes.Tables[0].Rows.Add(row); this.oPolicyNotesBiz.UpdateDataSet(dsPolicyNotes); } }Then I passes it to my Biz layer and then my Biz layer pass it to my DataAccess layer. My data access layer is trying to commit the changes to SQL Server. Here is the code:
public void UpdateDataSet(DataSet ds) { DataSet dirtyDS = ds.GetChanges(); //Take action. //ds.AcceptChanges(); SqlConnection con1 = new SqlConnection(this.connectionstring); con1.Open(); SqlDataAdapter sqlAdapter1 = new SqlDataAdapter(); sqlAdapter1.Update(ds,"PolicyNotes"); con1.Close(); }