Solved

Trouble getting a FormView to update with a Dataset datasource

Posted on 2008-10-23
3
957 Views
Last Modified: 2013-12-17
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?
0
Comment
Question by:jvalescu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 6

Expert Comment

by:WanaBRich
ID: 22785814
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"

0
 

Author Comment

by:jvalescu
ID: 22786554
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!
0
 
LVL 6

Accepted Solution

by:
WanaBRich earned 500 total points
ID: 22786665
You could put a defalut record in the Order Details table that has a ID of 1 lets say. You could populate that table with some thing like "No details available yet" Then when you create the first new header you can manually put in the default ID of 1 then you can chech to see if the ID = 1 on a edit and if it does then created a new record and replace the FK with the correct ID.

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question