Jump to content
Xtreme .Net Talk

sroberts

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by sroberts

  1. Thanks for your help. It is working know but I must have to do some binding in the groupbox fill method because it only updates the record for the first treenode selected. If you go to another node and update it updates the first one selected. Thanks again!
  2. First of all let me say that I am very new to .NET and C# and I need help so please bear with me. I have a tree control that is dynamically populated from a dataset of two joined tables. When a node is selected a groupbox is displayed on the right that has textboxes to display fields in the data set from the selected row. The fields are bound to the proper dataset column via the design properties page. The selected node shows the group box and then calls a method to populate the items in the group box passing the primary key for that row in the table. All this works fine the group box displays the appropriate information for the selected tree node. However when I add a update button and change any data the updates don't happen and no errors, just no changes to the data. I had thought that any fields bound to a dataset at design time would automatically reflect thier changes in the dataset. Here is the method that fills the groupbox: private void FillMaterialData(string MatNo) { if(MatNo != null) { DataRow currentRow; currentRow = dataSet11.MATERIALS.Rows.Find(MatNo); materialGroupBox.Text = "Material No. = " + MatNo; matNameTB.Text = System.Convert.ToString(currentRow ["MATNAME"]); matDescTB.Text = System.Convert.ToString(currentRow ["MATDESC"]); } } And here is the simple update event: private void btnUpdate_Click(object sender, System.EventArgs e) { sqlDataAdapter1.Update(dataSet11); sqlDataAdapter2.Update(dataSet11); MessageBox.Show("Data Updated!"); } Thanks in advance for any help. .
×
×
  • Create New...