Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating a single row to a database

Status
Not open for further replies.

goneWildCoder

Programmer
May 26, 2004
20
US
I have a textbox driven windows form in C# whose values corresponding to rows of a dataset being filled from a database table. When the user clicks the Insert button, I want to add a new row with values entered by the user.

After the user has finished entering a new record, I want to update the row to the dataset and subsequently to the database table. How do i do this?

I tried adding a row changing event and calling the update function in it; however, this means that the user must either click insert so that the row is changed before update is possible...

Any other solutions to get around this...??

Thanks
 
in general terms, if the controls are not data bound, then your 'insert' button clears the screen.
the user types their info.
then they either click SAVE or CANCEL
Save does an insert into the database, then 'moves' to the saved record, so that subsequent on screen changes affect the record you inserted.
Cancel populates the screen with whatever the 'current' record was before they tried to enter a new one.
Or have i misunderstood?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top