Solved

Session Dataset Value Get?

Posted on 2006-06-26
5
377 Views
Last Modified: 2008-01-16
I need to get a single value from a session dataset, but so far no luck.

I know data exists because I can merge this dataset with another dataset and save it to a database.

Here are my attempt:

DataSet ds = (DataSet)Session["mydataset"];

       string Product = Session["Product"].ToString();


0
Comment
Question by:kvnsdr
  • 3
  • 2
5 Comments
 
LVL 7

Expert Comment

by:brdrok
ID: 16987169
Perhaps only a typo???

string Product = ds["Product"].ToString();
0
 
LVL 1

Author Comment

by:kvnsdr
ID: 16987434
That's closer, but now I recieve an error:

Cannot apply indexing with [] to an expression of type 'System.Data.DataSet'

I've also tried:  string Product = ds.Tables[0].Columns[5].ToString();

then for the result I get the column name:  col_Product

I know the data is there, but...
0
 
LVL 7

Accepted Solution

by:
brdrok earned 250 total points
ID: 16987527
i believe you'll have to specify the row number...try the following:

string Product = ds.Tables[0].Rows[0][5].ToString();

where the [0] <= row number
where the [5] <= column number
0
 
LVL 7

Expert Comment

by:brdrok
ID: 17001878
do you mind if i ask why the grade of "B"?
0
 
LVL 1

Author Comment

by:kvnsdr
ID: 17003057
Sorry, I goofed........
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Sending E-mail ASP.Net 3 56
Code works but how can I download the file? 20 67
ADO.NET ENTITY DATA MODEL 3 30
Pagebreak issue while printing the aspx page 3 14
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

911 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

14 Experts available now in Live!

Get 1:1 Help Now