473,387 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Help with creating strongly typed DataSet

I'm designing an extranet web site that customers will use to log in and see their account history, make payments against their balance, etc.

I've declared a strongly typed DataSet as a public static object in the main accounts page - "public Customer.DataSet dsMyData = new Customer.DataSet();" and populate the tables with information about the account, services, etc which are referenced from the other pages as such: lblEMail.Text = CustScreen.dsMyData.Account[0].EMail;

Everything works great until two customers log in at roughtly the same time. Because the DataSet object is static, the second customer overwrites the DataSet with their account information, at which both customers see the information for the customer who logged in second.

Clearly, using a static object isn't going to work in an environment where multiple accounts are logging in at the same time. What would be the correct method for creating a strongly typed dataset that is unique to each asp.net session?

Thanks in advance for your help,

Andre
Nov 18 '05 #1
1 1484
Hi Andre,

You should be recreating your DataSet for each Web request unless the data
in the DataSet itself is static and read-only. If it's Read/Write data you
should reload on each hit in typical fashion for a stateless Web
application.

If your app is low volume you can also cache your DataSet in the Session
object on a per user basis, but in general this isn't a good idea and it may
cost you more in serialization than it does to pull the data as needed ffrom
the database.

Regards,

+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/
----------------------------------
Making waves on the Web
"Andre Ranieri" <an*******@discussions.microsoft.com> wrote in message
news:66**********************************@microsof t.com...
I'm designing an extranet web site that customers will use to log in and see their account history, make payments against their balance, etc.
I've declared a strongly typed DataSet as a public static object in the main accounts page - "public Customer.DataSet dsMyData = new
Customer.DataSet();" and populate the tables with information about the
account, services, etc which are referenced from the other pages as such:
lblEMail.Text = CustScreen.dsMyData.Account[0].EMail;
Everything works great until two customers log in at roughtly the same time. Because the DataSet object is static, the second customer overwrites
the DataSet with their account information, at which both customers see the
information for the customer who logged in second.
Clearly, using a static object isn't going to work in an environment where multiple accounts are logging in at the same time. What would be the
correct method for creating a strongly typed dataset that is unique to each
asp.net session?
Thanks in advance for your help,

Andre

Nov 18 '05 #2

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

Similar topics

0
by: | last post by:
We have an object factory that returns weakly typed datasets (just plain ol' DataSet's). I need to cast it, or transform it, or map it to a strongly typed dataset. There's an old adage I heard...
1
by: Steven | last post by:
Hi all My problem is a little lengthy. But please help me. In my application, ADO.NET DataSet object is not getting constructed in the Web Service Web Method called by the Windows Application...
2
by: theWizK | last post by:
Hello all. I have noticed that when I generate a strongly-typed dataset from an xml schema that the DataTables that are generated have their constructors marked as internal. What this means is...
1
by: Job Lot | last post by:
I am confused how strongly typed dataset is different from un-typed dataset. Is there any good link explaining pros and cons of both? Which one should be used preferably?
6
by: Graham Pengelly | last post by:
Hi I'll try to spell out my problem as succinctly as possible... My database has a User table, an Organisation table, a Department table and a JobType table (amongst others) The...
1
by: Andre Ranieri | last post by:
I'm designing an extranet web site that customers will use to log in and see their account history, make payments against their balance, etc. I've declared a strongly typed DataSet as a public...
10
by: pcthug | last post by:
Hi All, I am creating multi-tier app in vb.net using visual studio .net. I create a invoice.vb class file with properties, events and methods. This also has a line item collection class...
2
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
When I'm debugging a Windows Forms Application in VS2005 IDE, how can I check whether a dataset is strongly typed or not in Watch window? Are there some properties or methods only exist for...
4
by: Rachana | last post by:
Hi, I have understood Data Sets but what is meant by typed/untyped/ strongly typed datasets. Can any one explain me or suggest any site/ article, to get these concepts (and their ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...

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.