Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 23rd, 2004, 12:41 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default DataSet Question

   I have a data set question which may seem stuipid, but maybe someone can shed some light.
   I have a data set that is populated in my Page_Load event. I want to resuse this data set again in another event, however the rowcount is 0. I don't want to have to run the query and fill it again if possible.
   I created the dataset through the IDE, I assumed(bad idea) that it would be global to the page and available at any time. I even tried changing the data set declaration from:
Protected WithEvents DsCallCategories1 As CallBoxTEST.dsCallCategories
To:
Public WithEvents DsCallCategories1 As CallBoxTEST.dsCallCategories

How can I create a data set, fill it once, and use it continuously thoroughout the page? Would I need to cache it? Could I create it in the Global.asax and create and destroy as necessary?

Thanks for any help and ideas!!!

Jim
 
Old November 23rd, 2004, 04:45 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hello,
one of ways for preserving the values of your objects in ASP.NET pages is to declare them as static(shared),it prevents resetting objects among several requests.
(other ways:cache,sessions,...)
but I think for saving a dataset it's better to save it in cache or sessions not to declare it as global static....certianly cache objects are faster...

_____________________________
Mehdi.
software engineering student.
Looking for a good job for summer 2005.
 
Old November 23rd, 2004, 04:57 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

thanks.. I wound up using a session variable, then assigning it to a pre defined data set. thanks again






Similar Threads
Thread Thread Starter Forum Replies Last Post
Dataset question MaxGay2 VB.NET 2002/2003 Basics 1 November 16th, 2006 10:33 AM
Dataset Designer Question chrislepingwell ADO.NET 0 August 31st, 2006 06:27 AM
Dataset Question katsarosj ASP.NET 1.0 and 1.1 Basics 9 December 1st, 2005 07:05 AM
Dataset Question Ozymandias VB.NET 2002/2003 Basics 1 November 19th, 2003 12:00 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.