Getting the data out of the data Formview
I have an ASP pg with a formview list control on it that hooks up to a sql database customer table
I want to access the customer name outside the form.
How do I:
A) access the bound text box in the form view template? Something like Text1.text=formview1.customername.text (that doesn't work but that's the kinda thing)
B) access the database field in the table that the sqlsource connects to to feed the formview
Re: Getting the data out of the data Formview
Hey,
Welcome to the forums!!
First of all, can you show us the code/markup that you are currently using?
You mention that you are using a SqlDataSource, which in all honesty, is fine for Proof Of Concept scenarios, but in the real world, you are going to run into a number of problems using them, so you might want to think about refactoring out the use of the SqlDataSource, in favour of handling the coding yourself, once you have done this, you will have easy access to everything that you have asked for.
Take a look at the ADO.Net Links in my signature, they will give you some ideas about what you should do.
Gary
Re: Getting the data out of the data Formview
Woohooo!! Finally got the data outa the formview. You know what they say, you can take the data outa the formview, but ya can take the formview outa the data (or something like that).
Anyways thanks to all for the help. That was such a frustrating roadblock. When I tried FindControl before posting here I kept getting a string conversion error, but the help here cured me.
Cheers,
Dave
Re: Getting the data out of the data Formview
Hey,
Can you provide details about exactly what you were doing, and what you ended up using?
I think this will help other people who are searching with the same issue.
Gary
P.S. Remember to mark your thread as resolved.