Link to home
Start Free TrialLog in
Avatar of jvalescu
jvalescuFlag for United States of America

asked on

Trouble getting a FormView to update with a Dataset datasource

I have a Formview control that is databound to a dataset.  When I click on the "Update" button, it appears that there is no way to access the bound data or I'm just not seeing it.  I am handling the _ItemUpdating event.  Given my control name is FormView1, how can I get to the databound fields and their data?
Avatar of WanaBRich
WanaBRich
Flag of United States of America image

What do you want to do? for instance do you want to change a 1 or 0 in the DB to desplay "yes" or "no"

Avatar of jvalescu

ASKER

I have an Order Entry form with an Order Entry Header table and an Order Details table.  The user adds a new header record by filling in some textboxes and hitting "Save", creating the Order Header record and returning an Order ID.  This is the related key to the Order Details table.  Since there is no data in the Order Details table at this time, I could not get a FormView or GridView to populate.  Messing around with the EmptyDataTemplate for both didn't work out at all (ex. The FormView would show the fields, but when I hit "Edit", it did nothing.)  So I decided to do things "manually"; create a blank record in a dataset and use it as the Datasource for the Formview.  This worked OK.  I could even edit the record.  Now, when I hit "Update" to commit my changes, I want to be able to pull the data from the FormView dataset and commit them to the SQL database.  Sounds cludgy, but it was very frustrating.  So that's the long answer to your short question, unless you have a better idea...........................  Thanks!
ASKER CERTIFIED SOLUTION
Avatar of WanaBRich
WanaBRich
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial