S
Sam Carleton
I have followed the "Walkthrough: Displaying Data in a Windows
Form Using a Parameterized Query" and would like to modify it to
update the row being displayed.
If you are not familiar with the walkthrough, it is very simply.
You setup a Data Connection, then a Data Adapter, and finally a
Dataset. Then you add a few textboxes to the form and bind them
to the Dataset columns. One of the textboxes (txtStateParameter )
is for the user to enter the state id to lookup the specific.
Here is the only actuall code from the walkthrough, to this point:
private void btnShow_Click(object sender, System.EventArgs e)
{
oleDbDataAdapter1.SelectCommand.Parameters["state"].Value =
txtStateParameter.Text;
dsAuthors1.Clear();
oleDbDataAdapter1.Fill(dsAuthors1);
}
The question I have now is how do I update this row when the user
changes something on the form and clicks the save button? I have
seen others posting stating that with textboxes, one must first
call the BeginEdit() and EndEdit(). I dug around and found these
methods on the DataRow object. At this point, I don't have a
DataRow, only a Dataset.
Can anyone fill me in on what I am missing? Thanks!
Sam
Form Using a Parameterized Query" and would like to modify it to
update the row being displayed.
If you are not familiar with the walkthrough, it is very simply.
You setup a Data Connection, then a Data Adapter, and finally a
Dataset. Then you add a few textboxes to the form and bind them
to the Dataset columns. One of the textboxes (txtStateParameter )
is for the user to enter the state id to lookup the specific.
Here is the only actuall code from the walkthrough, to this point:
private void btnShow_Click(object sender, System.EventArgs e)
{
oleDbDataAdapter1.SelectCommand.Parameters["state"].Value =
txtStateParameter.Text;
dsAuthors1.Clear();
oleDbDataAdapter1.Fill(dsAuthors1);
}
The question I have now is how do I update this row when the user
changes something on the form and clicks the save button? I have
seen others posting stating that with textboxes, one must first
call the BeginEdit() and EndEdit(). I dug around and found these
methods on the DataRow object. At this point, I don't have a
DataRow, only a Dataset.
Can anyone fill me in on what I am missing? Thanks!
Sam