Solved

Chaching Dataset using session object

Posted on 2004-08-22
3
210 Views
Last Modified: 2010-04-17

Hello, new to .Net. I would like to cache a dataset to the session object because the data is coming from a file the user will upload, which I then want to display with edit capabilities on each row the user can change that have errors I flag before submitting this information to the database.

I think I have an idea on how to accomplish this, I will wind up with the cached object that I will display by by binding it to a dataset or datalist, with an eventhandler associated with each row that will access the corresponding cached information. What I don't understand is how to access a specific column in a specific row of that cached information. So, if I had a table with four rows, containing [column1] and [columns2], how would I ask for the value of [column2] in the thrid row?

Do I need to do anything special when I set it from the datasource, like so?

Session["MyDataSet"] = CreateDataSource();

If that's all I need to do, then what is the syntax for accessing a row in this manner?

thanks in advance, I'm in a crunch here and stuck on this, very appreciative of any help on this!!!



0
Comment
Question by:animated405
3 Comments
 
LVL 1

Expert Comment

by:confabber
ID: 11867914
0
 
LVL 2

Accepted Solution

by:
mahanatti earned 250 total points
ID: 11869043
To access the dataset in the Session object,

DataSet ds = (DataSet)Session["MyDataSet"];
string ReqVal = ds.Tables[0].Rows[3]["Column2"].ToString(); //You can also use the Column index instead of column name

Hope this helps.

-Maha
0
 

Author Comment

by:animated405
ID: 11886395

So far so good, Maha...thank you very much.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
maxMirror challenge 10 89
mergeTwo  challenge 13 72
array11 challenge 16 52
mapBully challenge 6 92
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now