Properties bound textboxes do not update.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steve Roberts

    Properties bound textboxes do not update.

    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 FillMaterialDat a(string MatNo)
    {
    if(MatNo != null)
    {
    DataRow currentRow;
    currentRow = dataSet11.MATER IALS.Rows.Find( MatNo);
    materialGroupBo x.Text = "Material No. = " + MatNo;
    matNameTB.Text = System.Convert. ToString(curren tRow
    ["MATNAME"]);
    matDescTB.Text = System.Convert. ToString(curren tRow
    ["MATDESC"]);
    }
    }

    And here is the simple update event:
    private void btnUpdate_Click (object sender,
    System.EventArg s e)
    {
    sqlDataAdapter1 .Update(dataSet 11);
    sqlDataAdapter2 .Update(dataSet 11);
    MessageBox.Show ("Data Updated!");
    }
    Thanks in advance for any help.
Working...