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?
Printable View
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?
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
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..
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.
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 :)
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.
http://msdn.microsoft.com/en-us/library/ms972833.aspx
hope this may work out 4 u...
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