473,698 Members | 2,611 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Session variables or DataSet Table

Hi,

I have a table in my database called users which contains user
information like their login id, password, first name, last name,
phone, etc. Once I retreive this information, I'd like to hold it in
memory. One obvious way of doing this is session variables. However, I
am thinking whether usign a Dataset would be more suitable in this
situation. If I create a table called "user" and store the user's
information in that table (it would have only one row with the user's
information) would that be a good way of doing this? (I have a feeling
it won't be, but I can't reason why).

I guess what I am fuzzy on is whether the dataset object is held in
memory and would be accessible throughout the application. Or would I
have to declare my dataset as a global object somewhere (where would I
do that?)

I would appreciate it if someone could help me think clearly about
this.

Regards,

Asad

Nov 30 '05 #1
2 1629
Simply having a dataset in a variable does not mean it will live beyond the
current page request. You still would have to add it to a session variable
to be maintained. Datasets have a lot of overhead with them because their
primary storage medium is XML (I think).

What I would do is to create some class that has that information and store
that class in the session variable.

For instance,

public class User{
public string Name{
get{return m_name;}
set{m_name = value;}
}

...
}

<as*******@gmai l.com> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .
Hi,

I have a table in my database called users which contains user
information like their login id, password, first name, last name,
phone, etc. Once I retreive this information, I'd like to hold it in
memory. One obvious way of doing this is session variables. However, I
am thinking whether usign a Dataset would be more suitable in this
situation. If I create a table called "user" and store the user's
information in that table (it would have only one row with the user's
information) would that be a good way of doing this? (I have a feeling
it won't be, but I can't reason why).

I guess what I am fuzzy on is whether the dataset object is held in
memory and would be accessible throughout the application. Or would I
have to declare my dataset as a global object somewhere (where would I
do that?)

I would appreciate it if someone could help me think clearly about
this.

Regards,

Asad

Nov 30 '05 #2
Makes perfect sense, thanks.

Just one clarification though, you mean you would add an object of this
class to session right? Not the entire class (I don't even know how you
could add a class to a session).

Asad

Dec 1 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2634
by: Rob | last post by:
I'm trying to use session variables to store datasets when moving from page to page (and returning). The datasets are small (I know some may comment on performance issues). It seems simple to use. I can pass a dataset to the second page (once I get one additional page working, the rest will be simple) successfully but am not able to return to the default page and retrieve the dataset and rebind it to my datagrid. Once I store it as a...
4
2046
by: Cowboy \(Gregory A. Beamer\) | last post by:
Background: ------------- The idea started as a single sign on type of application. Having tested it before, I knew we could institute single sign on using the same Authentication Cookie name (in this case "AuthenticationCookie" -- yeah, original, I know) and the same machine keys for the applications. <authentication mode="Forms"> <forms name="AuthenticationCookie" path="/" loginUrl="login.aspx" protection="All" timeout="10" />
2
3382
by: John Holmes | last post by:
I have a web interface where the user types in ID's one at a time. After an ID is typed in, a button is clicked and the button click event has code that does a query and returns a data reader and then appends the data to a dataset that is built in the Page_Load code in the if(!isPostBack) block. When I try to add a row in the button click event code I get an error saying that "Object reference not set to an instance of an object". I'm...
14
2258
by: Venkat Chellam | last post by:
I have a peculiar problem. I have a simple web application which loads some data from the oracle table and display in the datagrid in the webpage and datagrid has page enabled which shows 10 rows at a page.I have a search criteria to search the records based on the data range i give This is what i have done, in the !IsPostBack section. I am setting up the oracle connection, creating dataset object, datadapter and i aslo load the data...
31
6994
by: Harry Simpson | last post by:
I've come from the old ASP camp where session variables were not used. When i started using ASP.NET in 2001, I started using them again because it was ok from what I'd read. I've been merrily using Session variables for three years now and i'm entering a project with my new boss who has never quite come around that session variables are ok. What's the concensus here. How can i convince him that they are ok in ASP.NET. OR
2
2282
by: Stuart | last post by:
Hi there I am using several processes within an .asp application that store variables in to session - typically: Session("UniqueName") = Value I am having a hell of a time overwriting the Session value once it has been stored the first time - namely I can't
2
2097
by: Gavin Lyons via .NET 247 | last post by:
Hello, I'm writing a newsletter application which uses backgroundthreading. I'm using Session variable to report on progresswhile it loops through a dataset. The 'Status.aspx' pagerefreshes every 5 seconds while outputing the Session variables.My problem is, once the page redirects to 'Status.aspx' its showthe that's it only gets half through the dataset. If I increaseThread.Sleep to 2000 goes all the way through. I don't get anyerror...
3
1562
by: Aaron | last post by:
Why do my session values return to nothing on post back? I want to click a button and have the row, as in: dataset.table(0).rows(THIS ROW NUMBER IS WHAT I AM TALKING ABOUT), either increment or decrement to facilitate a movenext and movelast. I have been pulling my hair out and am at the end of my rope. PLEASE, how should I implement this? I have tried everything I can think of, which really isn't much considering I am just beginning...
0
1039
by: SLG31 | last post by:
I'm designing like a shopping cart and have a product list which is an xml file consisting of products and prices which is loaded into a dataset then bound to a datagrid There are buttons next to each product by clicking one of these should direct the user to another form showing the choice of product and price in textboxes, I can't load the info into the next form using session variables My code is below 1st form code {code}...
0
8610
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9031
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8902
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7740
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2339
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.