Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem updating Inserted row in my DataSet
Message
From
24/10/2007 11:07:20
 
 
To
24/10/2007 10:49:59
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
01262924
Message ID:
01263128
Views:
16
Are you using a Stored Procedure or direct table access?

Table.

My UI recieves a dataset, then I insert a row into my table.:
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();
 }
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform