Welcome to Dream.In.Code
Getting Help is Easy!

Join 132,705 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,389 people online right now. Registration is fast and FREE... Join Now!




Passing only 'selected' records to next page

 
Reply to this topicStart new topic

Passing only 'selected' records to next page

Nolan
post 18 Sep, 2008 - 03:17 PM
Post #1


New D.I.C Head

*
Joined: 12 Sep, 2007
Posts: 47


My Contributions


I have a database with individual expense entries related to particular projects.
One project can have many many expenses.
I have a web page that pulls all of the expense records that have NOT yet been invoiced for a given project and lists them in a table.
The table contains a checkbox which, when selected, I would like to pass all of the data to the next page for that particular expense entry.
I need to pass Expense_ID, and Expense_Date, Quantity, Description and Unit Cost (these 2 from a related table) for each record with a check box.

I'm using .asp

Can I ( should I ) do it like that (even if it's possible) or should I create an array on the following page and zoom through the expense table again?

User is offlineProfile CardPM

Go to the top of the page

Jayman
post 18 Sep, 2008 - 07:59 PM
Post #2


Student of Life

Group Icon
Joined: 26 Dec, 2005
Posts: 6,839



Thanked 38 times

Dream Kudos: 500

Expert In: C#, VB.NET, Java

My Contributions


How many records are you talking about?

You could just load all the data into a DataSet or DataTable and then store it in a session object. The session object will be accessible on the next page, just cast it back into the proper object type when you need it.

Example in C#:
CODE

//DataSet contains data to be passed to another page
DataSet ds = New DataSet();
//store the DataSet in a Session object
Session["myDataSet"] = ds;

//to get the data back on the next page, just cast it
DataSet ds1 = (DataSet)Session["myDataSet"];
User is offlineProfile CardPM

Go to the top of the page

Nolan
post 19 Sep, 2008 - 09:50 AM
Post #3


New D.I.C Head

*
Joined: 12 Sep, 2007
Posts: 47


My Contributions


I'm not familiar with the Dataset object but it sounds like it might be the way to go.

I tried this code simply as a test:
DataSet ds = New DataSet();

but got an error:
Compiler Error Message: BC30451: Name 'DataSet' is not declared.

Care to give me a bit more guidance?
Thanks
User is offlineProfile CardPM

Go to the top of the page

Jayman
post 19 Sep, 2008 - 10:01 AM
Post #4


Student of Life

Group Icon
Joined: 26 Dec, 2005
Posts: 6,839



Thanked 38 times

Dream Kudos: 500

Expert In: C#, VB.NET, Java

My Contributions


Make sure you import the following namespace.
CODE

using System.Data;


Don't forget to load all your data into the DataSet.
User is offlineProfile CardPM

Go to the top of the page

PsychoCoder
post 19 Sep, 2008 - 01:34 PM
Post #5


using DIC.Core;

Group Icon
Joined: 26 Jul, 2007
Posts: 8,933



Thanked 118 times

Dream Kudos: 8525

Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions


Also, remember C# is a strongly typed language so it's case sensitive, use new not New smile.gif
User is offlineProfile CardPM

Go to the top of the page

Jayman
post 20 Sep, 2008 - 09:53 AM
Post #6


Student of Life

Group Icon
Joined: 26 Dec, 2005
Posts: 6,839



Thanked 38 times

Dream Kudos: 500

Expert In: C#, VB.NET, Java

My Contributions


Haha, good catch. Guess I had VB on the brain. wink2.gif
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 08:28AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month