Results 1 to 8 of 8

Thread: Get Datalist value

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2003
    Location
    Newark-on-trent, Nottingham
    Posts
    243

    Get Datalist value

    I have a datalist that shows Label, Label2 and has 8 rows of data.

    I would like to store the value in Label2 row 8 in a session variable... how can i do this in VB.net?

  2. #2
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Get Datalist value

    Hey,

    What is the requirement for this?

    Can you store the value when the DataList is bound? On at what point do you want it added to the Session?

    Gary

  3. #3
    Hyperactive Member dnanetwork's Avatar
    Join Date
    Oct 2007
    Location
    Mumbai
    Posts
    349

    Re: Get Datalist value

    yes you can...but i'm preety curious about the situation...!

    fire the query using sqlcommand object and get the data in reader..

    and from reader add to array list and finally add arraylist to session..

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Oct 2003
    Location
    Newark-on-trent, Nottingham
    Posts
    243

    Re: Get Datalist value

    My datalist contains the results of a total of all the different financial totals by line type with a grand total at the bottom (row 8 of the datalist).

    I would like to be able to insert that value into a total_revenue field in my sql database when the user has reviewed the information and clicked a button, so i guess on databound would be fine.

    I hve been playing around with vb code such as DataList3.DataKeys(7).ToString() but clearly this is not the right approach.

  5. #5
    Hyperactive Member dnanetwork's Avatar
    Join Date
    Oct 2007
    Location
    Mumbai
    Posts
    349

    Thumbs up Re: Get Datalist value

    yes u r correct on rowdatabound event calculate the whole value and finally capture it in session and then use it anywhere you like...

    one more query...if u know this stuff can be done at rowdatabound..

    then why r u asking ...why dnt u give it a try...

    best of luk

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Oct 2003
    Location
    Newark-on-trent, Nottingham
    Posts
    243

    Re: Get Datalist value

    I couldnt get the right combination of the properties of datalist3 to be able to return the value.

    The 8th row of my data list is the total so on rowdatabound i want to set a variable or session to equal the value of DataList3 column 1 row 8.

    In my head it works but i cant get that value to return.

  7. #7
    Hyperactive Member dnanetwork's Avatar
    Join Date
    Oct 2007
    Location
    Mumbai
    Posts
    349

    Re: Get Datalist value


  8. #8
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Get Datalist value

    stephena,

    We are not really going to be able to help you until you start explaining exactly what you want to do. Perhaps showing some of your code will help?

    Gary

Posting Permissions

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



Click Here to Expand Forum to Full Width