Solved

Session Dataset Value Get?

Posted on 2006-06-26
5
405 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

691 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