473,493 Members | 4,333 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How can I store DataList DataItem values to Session variable?

Let's assume a database with a parent table and a child table in a
one-to-many relationship, respectively. I have a DataList control on page P
that displays values from the parent table. Each row (rP) in the DataList
control has a link that takes the user to page C, where they can view the
records in the child table corresponding to the selected row rP. Page C needs
to repeat the values from rP at the top.

Since I have already retreived the values from rP, how can I bind them on
page C without making another trip to the database server? I'm assuming
there's a way to capture the values from rP to a session variable for use on
page C, but how?

Any pointers?
Nov 19 '05 #1
3 5036
In this case, you can store the values in a session or cookie, but also do
take a look at query strings, if its just few pieces of data you need to
pass...
Hth..
R. Thomas

"Tillman Erb" wrote:
Let's assume a database with a parent table and a child table in a
one-to-many relationship, respectively. I have a DataList control on page P
that displays values from the parent table. Each row (rP) in the DataList
control has a link that takes the user to page C, where they can view the
records in the child table corresponding to the selected row rP. Page C needs
to repeat the values from rP at the top.

Since I have already retreived the values from rP, how can I bind them on
page C without making another trip to the database server? I'm assuming
there's a way to capture the values from rP to a session variable for use on
page C, but how?

Any pointers?

Nov 19 '05 #2
Thanks Thomas,

Are you suggesting storing them to the session in an array object? Is there
some way I could just grab the DataItem or DataRow from the DataList?

I had considered a query string, but one of the row values could be a very
long text string.

~ Tillman

"R. Thomas [Xtreme.Net]" wrote:
In this case, you can store the values in a session or cookie, but also do
take a look at query strings, if its just few pieces of data you need to
pass...
Hth..
R. Thomas

"Tillman Erb" wrote:
Let's assume a database with a parent table and a child table in a
one-to-many relationship, respectively. I have a DataList control on page P
that displays values from the parent table. Each row (rP) in the DataList
control has a link that takes the user to page C, where they can view the
records in the child table corresponding to the selected row rP. Page C needs
to repeat the values from rP at the top.

Since I have already retreived the values from rP, how can I bind them on
page C without making another trip to the database server? I'm assuming
there's a way to capture the values from rP to a session variable for use on
page C, but how?

Any pointers?

Nov 19 '05 #3
Yes, Array object would be one of the choices.
R. Thomas

"Tillman Erb" wrote:
Thanks Thomas,

Are you suggesting storing them to the session in an array object? Is there
some way I could just grab the DataItem or DataRow from the DataList?

I had considered a query string, but one of the row values could be a very
long text string.

~ Tillman

"R. Thomas [Xtreme.Net]" wrote:
In this case, you can store the values in a session or cookie, but also do
take a look at query strings, if its just few pieces of data you need to
pass...
Hth..
R. Thomas

"Tillman Erb" wrote:
Let's assume a database with a parent table and a child table in a
one-to-many relationship, respectively. I have a DataList control on page P
that displays values from the parent table. Each row (rP) in the DataList
control has a link that takes the user to page C, where they can view the
records in the child table corresponding to the selected row rP. Page C needs
to repeat the values from rP at the top.

Since I have already retreived the values from rP, how can I bind them on
page C without making another trip to the database server? I'm assuming
there's a way to capture the values from rP to a session variable for use on
page C, but how?

Any pointers?

Nov 19 '05 #4

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

Similar topics

2
3820
by: Mal P | last post by:
Hi there, I'm a J2EE fellow who (as usual) has been thrown in the deep end and have to learn a fair chunk of the .NET platform (VS, ADO, WebForms, C# etc) in roughly two days. I'm doing ok so...
3
4715
by: Hardy Wang | last post by:
Hi all; I have a DataList with ItemCreated event like below: private void myList_ItemCreated(object sender , DataListItemEventArgs e) { DataRowView myRowView; DataRow myRow; if (e.Item.DataItem...
6
1317
by: Thanh | last post by:
I created an ASP.NET project and dropped a DataList on the web form. I then wrote a simple class to return data: namespace Playing { public class PositionData { private string name; private...
4
8276
by: jenn | last post by:
Hi Anyone knows how to access to a value of a row in a datalist. Something like this in datagrid Dim str = MyDataGrid.Cell(0).tex I would like something like this Dim str =...
4
2466
by: Joe Van Meer | last post by:
Hi, Is the datalist meant for one table or can I use it to display information from 2 different tables? Or should I be looking at a datagrid instead? I began my code and kinda ran into a snag...
4
1166
by: Lerp | last post by:
I have a dataset that is made up of info from 2 tables. I have created a relationship between these 2 and have added it to the dataset. My datalist is working perfectly minus one little problem,...
10
2817
by: Bharat | last post by:
Hi Folks, Suppose I have two link button on a page (say lnkBtn1 and lnkBtn2). On the click event of the lnkbtn1 I have to add a dynamically created control. And On the click event of the lnkBtn2 I...
3
2769
by: CVerma | last post by:
Hi, I have an embedded datagrid within a datalist. I am not able to perfrom paging in the datagrid. Any ideas? Here is my code: Here is my Simplegrid.cs file: using System; using...
3
8238
by: mroffey | last post by:
Hi everyone, I've been having this problem and I've searched high and low, but I can't seem to find the answer to what is probably a very simple solution. In a nutshell, I have a nested...
0
6980
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...
0
7157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6862
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7364
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5452
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4579
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...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1397
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 ...
1
637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.