473,842 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Populate Session Variables from Datagrid for a specific cell

I need to know how to get a specific row/cell of data to post as a session variable - like I would with an ASP.Net table:

Dim ld_sum_tot_cty_ tax As Doubl
Session("wa_tot _gal") = tbl_worksheet1. Rows(16).Cells( 3).Text(

I am using VB.Net as the code behind, and populating the datagrid dynamically in a VB.Net Class Module - I am NOT connecting to an SQL database, but I do use the databind function

dtg_worksheet1. DataSource = lo_AZRM005A.get _dt_worksheet
dtg_worksheet1. DataBind(

How can I do this programmaticall y with the datagrid? Any help is GREATLY appreciated! Coleen

---
Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest Community Website: http://www.dotnetjunkies.com/newsgroups/
Nov 18 '05 #1
3 2584
Every row of data which is bound to the grid fires the itemdatabound event.
So in its handler, you can take the appropriate action. Consider
Session["row"] = e.item.cells[0].text will store the first colum of the row
being bou nd

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
<coleenholley > wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
I need to know how to get a specific row/cell of data to post as a session variable - like I would with an ASP.Net table:
Dim ld_sum_tot_cty_ tax As Double
Session("wa_tot _gal") = tbl_worksheet1. Rows(16).Cells( 3).Text()

I am using VB.Net as the code behind, and populating the datagrid dynamically in a VB.Net Class Module - I am NOT connecting to an SQL
database, but I do use the databind function:
dtg_worksheet1. DataSource = lo_AZRM005A.get _dt_worksheet1
dtg_worksheet1. DataBind()

How can I do this programmaticall y with the datagrid? Any help is GREATLY appreciated! Coleen
---
Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest

Community Website: http://www.dotnetjunkies.com/newsgroups/
Nov 18 '05 #2
Thanks - that helps, but I need to get the value from a Specific row - the data returned will ALWAYS have 17 rows - it will return one row for each County in Nevada, and there are 17 Counties. I specifically need to get the value from row (county) 16 for a session variable. Using Session["row"] = e.item.cells[7].text will store the seventh colum of the which row? How do I tell it to specifically get row 16? I REALLY need to have the functionality of Row(16).Cell(7) ; it is imperitive to the application we are building...any suggestions on getting the exact row number? Thanks for your help. Coleen

---
Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest Community Website: http://www.dotnetjunkies.com/newsgroups/
Nov 18 '05 #3
off the top of my head, if i didn't have the dataset already cached, i'd
collect each row and stack it into an array list. Then push that array list
into session.

Remind me again why you need to have this in a session variable (i've lost
the original thread)? It would seem to me that if you cache the entire
dataset, or datatable, then you could easily retrieve the dataset and access
the value directly. Consider:

DataSet ds = Session["Data"] as DataSet;
if(ds != null && ds.Tables[0].Rows.Count > 16)
value = ds.Tables[0].Rows[16][7].ToString();

Ofcourse, it is more memory efficient to cache a datatable or to stack just
the rows in an arraylist.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
<coleenholley > wrote in message
news:uP******** ******@TK2MSFTN GP10.phx.gbl...
Thanks - that helps, but I need to get the value from a Specific row - the data returned will ALWAYS have 17 rows - it will return one row for each
County in Nevada, and there are 17 Counties. I specifically need to get the
value from row (county) 16 for a session variable. Using Session["row"] =
e.item.cells[7].text will store the seventh colum of the which row? How do
I tell it to specifically get row 16? I REALLY need to have the
functionality of Row(16).Cell(7) ; it is imperitive to the application we are
building...any suggestions on getting the exact row number? Thanks for your
help. Coleen
---
Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest

Community Website: http://www.dotnetjunkies.com/newsgroups/
Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1503
by: Al Jones | last post by:
This was originally posted in the VBScript forum, several of my other questions have been vbscript related, one of the fine fellows there suggest I might want to post it as well in the jscript group, so since I'm heading toward staching these values in session vars I figured I'd toss it out here as well.. I'm back with something that makes no sense to me .... as far as I can see the three if statements are identical except for the...
4
42051
by: Wayne | last post by:
Hi, I'm new to .NET and have a question about the use of static variables vs. session variables in a web form in C#. Instead of using a session variable to hold a string to persist during datagrid paging. Can I use a static variable? Also, if I use a static variable is that variable shared by everyone that brings up the aspx page? Ex, if 4 people are viewing the aspx page is an instance of the static variable created for each of the...
4
1976
by: Tony | last post by:
I have a classic ASP application that determines whether a user is logged in by examining a Session Variable, Session("LoginId"). Once logged in there is a link to a new search page (.aspx) this page basicaly allows searcing of the database and selection of users from a DataGrid. When a user in the DataGrid is selected (using hyperlink) you are returned to the .asp page, however the Session("LoginId") is empty and the users then have to log...
10
1717
by: Michael SL | last post by:
I have been using session variables in my asp.net application without any trouble. But now in a very specific case I am losing them. On one of my pages I set a date in a dropdownlist (autopostback=false) and then click a "Build" button which builds a report. Most of the time there is no problem. But sometimes the following happens. I step through the code no problem, the session variables do not change. But, when examined after the the...
3
1585
by: Matt Mercer | last post by:
Hi all, I have read much about session variables and the pros and cons. I want to post my use and get opinions. When a user logs into my site various fields are pulled from a SQL user table. I store the user's name, ID, country, region, site code, and access level in session variables. I use this information to decide what fields the user can see, what he
5
1522
by: Max | last post by:
Hi All! I'm doing an ASP.NET project which uses Persistent Forms Authentication (i.e. once user logged in, they don't have to log in again). However Session variables are erased after Session has timed out. So I need to re-populate user specific session variables (such as user email, DOB, Full Name...etc) when Session has ended. But strangely, when I tried to do something like....
9
3195
by: Randy | last post by:
Hello, I'm having a strange problem. I've got a .NET web app which uses Session variables. Sometime, not all the time, they get cross threaded...that is...one user will have another user's Session variable(s) data assigned to them. I can't figure out why. I've read that other people are having this problem too but I haven't found a resolution yet. Can someone please tell me how I might go about fixing this? Thanks
1
2270
by: Gidi | last post by:
Hi, Is it possible to Disable editing of one specific cell in one specific row in dataGrid? Thanks, Gidi.
0
1557
by: ahoyer | last post by:
Im currently writing a small phone directory, that allows a user to search by given name, surname, address, etc. everything is implemented with asp.net (the backend is in c#). My problem comes about when i want to pass the user entered values across to another window, that displays the results, using javascript. The easiest and most secure way for me to do this i think would be using asp.net's session variables. I know how to access...
0
9875
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
9715
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10614
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7040
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5697
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5886
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4500
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4090
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3146
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.