dcsimg
Results 1 to 4 of 4

Thread: Getting the data out of the data Formview

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2010
    Posts
    9

    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

  2. #2
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,966

    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

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2010
    Posts
    9

    Resolved 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

  4. #4
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,966

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width