Ah! Yeah, all the examples I've been seeing/reading are using datasets.
I'm self-teaching ASP.NET via books and am getting lost.
I'll look at using a datareader and see if that helps. If not, I'll post my
code.
Thanks for the suggestion!
Stephanie
-----Original Message-----
From: Ray Jezek (TT) [mailto:ray.jezek@t...]
Sent: Friday, September 27, 2002 11:07 AM
To: ASPX_Professional
Subject: [aspx_professional] Re: Maximizing performance
Use datareaders instead of datasets... they are AT LEAST twice as fast and
dont sit in memory. If your doing tons of updates, *maybe* a dataset would
be better. I personally dont use datasets for anything because I dont like
the thought of all that data sitting in memory for each user. Thats just me
though.
It's unfortunate that most of the example you see out there use datasets so
much because they are horribly in-effecient.
-----Original Message-----
From: Patterson, Stephanie L [mailto:stephanie.l.patterson@i...]
Sent: Friday, September 27, 2002 12:57 PM
To: ASPX_Professional
Subject: [aspx_professional] Re: Maximizing performance
Thanks Imar for the quick response. "Forever" can be anywhere from 45 sec
to 2 min.
Have a great weekend!
Stephanie
-----Original Message-----
From: Imar Spaanjaars [mailto:Imar@S...]
Sent: Friday, September 27, 2002 10:23 AM
To: ASPX_Professional
Subject: [aspx_professional] Re: Maximizing performance
Hi Stephanie,
Can you define "forever"? How long does it take to get the data? Maybe you
could optimize the way your query works (for example, get just what you
need, instead of using SELECT *).
In general, here's what I would do (and what I see in most examples).
If Not Page.IsPostback Then
' First hit to the page
BindMyData()
Else
' Let ViewState do its thing.
End If
Private Sub BindMyData()
' Get the data you need
' and bind it to a DataGrid for example
End Sub
Private Sub DeleteMyRecord()
' Do whatever you need to do to delete your record
' Then rebind the grid because the data has changed
' BindMyData()
End Sub
This way, you just get to the database when the current user has changed
some data.
This still doesn't update the grid when another user has changed the data,
though. To get this to work, you could bind the data on every hit to the
page. This indeed will cause a lot of performance overhead. There are
however a few work arounds:
If you use caching, you could save the data in the cache. Bind your
DataGrids to the cached data instead of getting a fresh copy of it every
time the page gets requested. Whenever a user changes some data, invalidate
the cache so it will be repopulated every time it's necessary. I saw a
"proof of concept" some time ago, that had a trigger on a database table
that was able to invalidate the cache. However, there were quite a few
problems with this solution, so I wouldn't suggest it.
Let me know if you need more info on this.
Regards, and have a nice weekend.
Imar
At 09:59 AM 9/27/2002 -0700, you wrote:
>I didn't get any help from the "ASPX Beginners" list, hopefully someone
here
>can help...
>
>I want to maximize my performance, so I am assuming I only want to read the
>table titles from SQL once and do my processing some ASP.NET object. Is
>this correct?
>
>It seems that if I refill the dataset everytime the page loads, it takes
>'forever' for the page to load. But, because this is a 'disconnected'
>application, I need to re-fetch from SQL to ensure I have the current data.
>I seem to be stuck in a Catch-22.
>
>What am I missing?
>
>Thanks for any insight!
>Stephanie
---
ASP.NET 1.0 Namespace Reference with C#
http://www.wrox.com/acon11.asp?ISBN=1861007442
ASP.NET 1.0 Namespace Reference with VB.NET
http://www.wrox.com/acon11.asp?ISBN=1861007450
These books are a complete reference to the ASP.NET namespaces
for developers who are already familiar with using ASP.NET.
There is no trivial introductory material or useless .NET
hype and the presentation of the namespaces, in an easy-to use
alphabetical order ensures a user-friendly reference format.
We provide in-depth coverage of all the major ASP.NET classes,
giving you those real-world tips that the documentation doesn't
offer, and demonstrating complex techniques with simple
examples.
---
---
ASP.NET 1.0 Namespace Reference with C#
http://www.wrox.com/acon11.asp?ISBN=1861007442
ASP.NET 1.0 Namespace Reference with VB.NET
http://www.wrox.com/acon11.asp?ISBN=1861007450
These books are a complete reference to the ASP.NET namespaces
for developers who are already familiar with using ASP.NET.
There is no trivial introductory material or useless .NET
hype and the presentation of the namespaces, in an easy-to use
alphabetical order ensures a user-friendly reference format.
We provide in-depth coverage of all the major ASP.NET classes,
giving you those real-world tips that the documentation doesn't
offer, and demonstrating complex techniques with simple
examples.
---
---
ASP.NET 1.0 Namespace Reference with C#
http://www.wrox.com/acon11.asp?ISBN=1861007442
ASP.NET 1.0 Namespace Reference with VB.NET
http://www.wrox.com/acon11.asp?ISBN=1861007450
These books are a complete reference to the ASP.NET namespaces
for developers who are already familiar with using ASP.NET.
There is no trivial introductory material or useless .NET
hype and the presentation of the namespaces, in an easy-to use
alphabetical order ensures a user-friendly reference format.
We provide in-depth coverage of all the major ASP.NET classes,
giving you those real-world tips that the documentation doesn't
offer, and demonstrating complex techniques with simple
examples.
---