Solved

Session Dataset Value Get?

Posted on 2006-06-26
5
369 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
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 demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

707 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

17 Experts available now in Live!

Get 1:1 Help Now