Thursday, March 29, 2012
Performance related Question.....
can use the Label control to display my data here since I am using this edit
box as read only. Will there be any advantage of using label box instead of
text box in terms of memory usage or any other performance issue ? Please
advice.
CrisHi,
I don't think there are big differences between label and textbox, Both
of them are persistent accross requests.
The only difference is that the label iclude the text within <span> tags
while the textbox in the value property of the <input> tag. So there is
just a sligthly difference in the amount of byte sent to the browser.
Hope this helps
Stefano Mostarda MCP
Rome Italy
Cris Rock wrote:
> In my ASP.Net application I am using webcontrols.TextBox to display data. I
> can use the Label control to display my data here since I am using this edit
> box as read only. Will there be any advantage of using label box instead of
> text box in terms of memory usage or any other performance issue ? Please
> advice.
> Cris
>
Friday, March 16, 2012
Persist data in XML data island
on the cleint side. The user should be able to scroll through the
records, modify any or all fields in any or all records, add records,
and delete records.
As far as I can see, there are a couple of ways to implement this. I
could persist the original data island and create a duplicate data
island that the user would modify. When the modifications were
complete, I could post back both XML snippets and compare them to see
what has changed.
Alternatively, I was thinking about using the DiffGram idea, where
each change would add an xml element to an xml snippet that would
indicate what item was changed, added, deleted, etc.
I know that I am not the first person to want to use this type of
technique, so I was hoping that there is something built into the .Net
framework to help with the management of the data. Ideally, I would
like to do something like serialize a dataset to XML, send it to the
client as an XML data island, have them manipulate it, repost it, and
then turn it "magically" into a batch update to the dataset on the
server side. Is that possible, or do I have to roll my own solution?
Thanks.
PatIf you read the XML back into a dataset, then you can use .getchanges on the
datatable to get only the changed rows. Send this back to the server in a
dataset. One easy way to do this is to use web services on the server.
"Pat Alessi" <pwalessi1@.hotmail.com> wrote in message
news:5de67752.0405250947.7f526dc4@.posting.google.c om...
> I want to use an XML data island to display editable records to a user
> on the cleint side. The user should be able to scroll through the
> records, modify any or all fields in any or all records, add records,
> and delete records.
> As far as I can see, there are a couple of ways to implement this. I
> could persist the original data island and create a duplicate data
> island that the user would modify. When the modifications were
> complete, I could post back both XML snippets and compare them to see
> what has changed.
> Alternatively, I was thinking about using the DiffGram idea, where
> each change would add an xml element to an xml snippet that would
> indicate what item was changed, added, deleted, etc.
> I know that I am not the first person to want to use this type of
> technique, so I was hoping that there is something built into the .Net
> framework to help with the management of the data. Ideally, I would
> like to do something like serialize a dataset to XML, send it to the
> client as an XML data island, have them manipulate it, repost it, and
> then turn it "magically" into a batch update to the dataset on the
> server side. Is that possible, or do I have to roll my own solution?
> Thanks.
> Pat
So, I could create a dataset, serialize it and send it down to the
client. Then, on the client side, I could bind it to some controls,
let the user add, delete, and modify records. Then, on repost, I
should convert the data back into a dataset, and call .getchanges? I
don't see how getchanges would work without having the original
dataset to compare the new dataset to?
How could I implement this with web services without posting the
information back to the server for every change?
Pat
"Rick Spiewak" <rickspiewak@.mindspring.com> wrote in message news:<#BJ7SftQEHA.3420@.TK2MSFTNGP11.phx.gbl>...
> If you read the XML back into a dataset, then you can use .getchanges on the
> datatable to get only the changed rows. Send this back to the server in a
> dataset. One easy way to do this is to use web services on the server.
> "Pat Alessi" <pwalessi1@.hotmail.com> wrote in message
> news:5de67752.0405250947.7f526dc4@.posting.google.c om...
> > I want to use an XML data island to display editable records to a user
> > on the cleint side. The user should be able to scroll through the
> > records, modify any or all fields in any or all records, add records,
> > and delete records.
> > As far as I can see, there are a couple of ways to implement this. I
> > could persist the original data island and create a duplicate data
> > island that the user would modify. When the modifications were
> > complete, I could post back both XML snippets and compare them to see
> > what has changed.
> > Alternatively, I was thinking about using the DiffGram idea, where
> > each change would add an xml element to an xml snippet that would
> > indicate what item was changed, added, deleted, etc.
> > I know that I am not the first person to want to use this type of
> > technique, so I was hoping that there is something built into the .Net
> > framework to help with the management of the data. Ideally, I would
> > like to do something like serialize a dataset to XML, send it to the
> > client as an XML data island, have them manipulate it, repost it, and
> > then turn it "magically" into a batch update to the dataset on the
> > server side. Is that possible, or do I have to roll my own solution?
> > Thanks.
> > Pat
Don't bind to the XML, re-create the dataset. Then you can do getchanges
against the modified table, re-create a dataset with just the changes,
and send that back up to the server.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Persist data in XML data island
on the cleint side. The user should be able to scroll through the
records, modify any or all fields in any or all records, add records,
and delete records.
As far as I can see, there are a couple of ways to implement this. I
could persist the original data island and create a duplicate data
island that the user would modify. When the modifications were
complete, I could post back both XML snippets and compare them to see
what has changed.
Alternatively, I was thinking about using the DiffGram idea, where
each change would add an xml element to an xml snippet that would
indicate what item was changed, added, deleted, etc.
I know that I am not the first person to want to use this type of
technique, so I was hoping that there is something built into the .Net
framework to help with the management of the data. Ideally, I would
like to do something like serialize a dataset to XML, send it to the
client as an XML data island, have them manipulate it, repost it, and
then turn it "magically" into a batch update to the dataset on the
server side. Is that possible, or do I have to roll my own solution?
Thanks.
PatIf you read the XML back into a dataset, then you can use .getchanges on the
datatable to get only the changed rows. Send this back to the server in a
dataset. One easy way to do this is to use web services on the server.
"Pat Alessi" <pwalessi1@.hotmail.com> wrote in message
news:5de67752.0405250947.7f526dc4@.posting.google.com...
> I want to use an XML data island to display editable records to a user
> on the cleint side. The user should be able to scroll through the
> records, modify any or all fields in any or all records, add records,
> and delete records.
> As far as I can see, there are a couple of ways to implement this. I
> could persist the original data island and create a duplicate data
> island that the user would modify. When the modifications were
> complete, I could post back both XML snippets and compare them to see
> what has changed.
> Alternatively, I was thinking about using the DiffGram idea, where
> each change would add an xml element to an xml snippet that would
> indicate what item was changed, added, deleted, etc.
> I know that I am not the first person to want to use this type of
> technique, so I was hoping that there is something built into the .Net
> framework to help with the management of the data. Ideally, I would
> like to do something like serialize a dataset to XML, send it to the
> client as an XML data island, have them manipulate it, repost it, and
> then turn it "magically" into a batch update to the dataset on the
> server side. Is that possible, or do I have to roll my own solution?
> Thanks.
> Pat
So, I could create a dataset, serialize it and send it down to the
client. Then, on the client side, I could bind it to some controls,
let the user add, delete, and modify records. Then, on repost, I
should convert the data back into a dataset, and call .getchanges? I
don't see how getchanges would work without having the original
dataset to compare the new dataset to?
How could I implement this with web services without posting the
information back to the server for every change?
Pat
"Rick Spiewak" <rickspiewak@.mindspring.com> wrote in message news:<#BJ7SftQEHA.3420@.TK2MSFT
NGP11.phx.gbl>...
> If you read the XML back into a dataset, then you can use .getchanges on t
he
> datatable to get only the changed rows. Send this back to the server in a
> dataset. One easy way to do this is to use web services on the server.
> "Pat Alessi" <pwalessi1@.hotmail.com> wrote in message
> news:5de67752.0405250947.7f526dc4@.posting.google.com...
Don't bind to the XML, re-create the dataset. Then you can do getchanges
against the modified table, re-create a dataset with just the changes,
and send that back up to the server.
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!
Persisting a dataset between event handlers
this.
I want to read a datset from a database, and display information from one
row at a time, using a Next and a Previous button to navigate through the
dataset.
I read the dataset in the first Page_Load event ie. inside an if
(!IsPostBack) condition, but it is gone again once I get to the button click
event.
Is there no alternative but to reopen the connection and read the entire
dataset every time a button is pushed? Or am I missing something?
--
DaveDave schrieb:
> I want to read a datset from a database, and display information from one
> row at a time, using a Next and a Previous button to navigate through the
> dataset.
> I read the dataset in the first Page_Load event ie. inside an if
> (!IsPostBack) condition, but it is gone again once I get to the button cli
ck
> event.
Have you checked that your code is executed in the same request (both the
dataset loading and the button click)?
If you click a button a postback is initiated and you wrote that you load
the database entry only if the request is *not* a postback...
Jan
I don't read the data in the button_click event, I only read it in the
Page_Load event.
If I read the database in the Page_Load event even when it is a postback,
then I read the whole recordset from the database every time the user pushes
a button. My question is, must I do this, or is there a better way.
--
Dave
"Jan Peter Stotz" wrote:
> Dave schrieb:
>
> Have you checked that your code is executed in the same request (both the
> dataset loading and the button click)?
> If you click a button a postback is initiated and you wrote that you load
> the database entry only if the request is *not* a postback...
> Jan
>
Dave wrote:
> Is there no alternative but to reopen the connection and read the entire
> dataset every time a button is pushed? Or am I missing something?
Nope. You're not missing anything. CGI programming is stateless. CGI
programming in ASP.NET gives you the ability to hide this fact from
yourself in certain cases, but this is not one of them.
You will need to open a new connection to the database with every
postback to the server. Your page is posting back behind the scenes to
drop you off at that OnClick handler. You'll have access to the
information on the Form, QueryString, Cookies, and Session state.
Hopefully you will have stashed enough information there to enable you
to rebuild your DataSet.
Good luck!
Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com
"examnotes" <Dave@.discussions.microsoft.com> wrote in
news:1E22A124-ECFA-449B-A125-1C35BB7B4665@.microsoft.com:
> I read the dataset in the first Page_Load event ie. inside an if
> (!IsPostBack) condition, but it is gone again once I get to the button
> click event.
> Is there no alternative but to reopen the connection and read the
> entire dataset every time a button is pushed? Or am I missing
> something?
If it takes a long time to execute the query, you could store the entire
dataset as a session variable.
Lucas Tam (REMOVEnntp@.rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
[url]http://members.ebay.com/aboutme/
Aargh!
Please don't store datasets in the Session object.
It's far preferrable to use the Cache object for that.
See sample at :
http://dotnethero.com/hero/Dataset/Cache.aspx?nmx=3_4
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
Ven, y hablemos de ASP.NET...
======================
"Lucas Tam" <REMOVEnntp@.rogers.com> wrote in message
news:Xns96BA12F5D238nntprogerscom@.127.0.0.1...
> "examnotes" <Dave@.discussions.microsoft.com> wrote in
> news:1E22A124-ECFA-449B-A125-1C35BB7B4665@.microsoft.com:
>
> If it takes a long time to execute the query, you could store the entire
> dataset as a session variable.
>
> --
> Lucas Tam (REMOVEnntp@.rogers.com)
> Please delete "REMOVE" from the e-mail address when replying.
> [url]http://members.ebay.com/aboutme/
Thanks Jason, and eveyone else. That's what I thought. I gather from my
reading that the database engines are pretty good at caching, so there
shouldn't be a huge performance hit.
--
Dave
"jasonkester" wrote:
> Dave wrote:
> Nope. You're not missing anything. CGI programming is stateless. CGI
> programming in ASP.NET gives you the ability to hide this fact from
> yourself in certain cases, but this is not one of them.
> You will need to open a new connection to the database with every
> postback to the server. Your page is posting back behind the scenes to
> drop you off at that OnClick handler. You'll have access to the
> information on the Form, QueryString, Cookies, and Session state.
> Hopefully you will have stashed enough information there to enable you
> to rebuild your DataSet.
> Good luck!
> Jason Kester
> Expat Software Consulting Services
> http://www.expatsoftware.com
>
Now THAT'S useful information. I realised using the Session object wasn't a
good idea, but I didn't know about the cache object. I'll look for more
information on that. Thanks.
--
Dave
"Juan T. Llibre" wrote:
> Aargh!
> Please don't store datasets in the Session object.
> It's far preferrable to use the Cache object for that.
> See sample at :
> http://dotnethero.com/hero/Dataset/Cache.aspx?nmx=3_4
>
> Juan T. Llibre
> ASP.NET MVP
> http://asp.net.do/foros/
> Foros de ASP.NET en Espa?ol
> Ven, y hablemos de ASP.NET...
> ======================
> "Lucas Tam" <REMOVEnntp@.rogers.com> wrote in message
> news:Xns96BA12F5D238nntprogerscom@.127.0.0.1...
>
>
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in news:#UV2KdvpFHA.2904
@.tk2msftngp13.phx.gbl:
> Aargh!
> Please don't store datasets in the Session object.
> It's far preferrable to use the Cache object for that.
> See sample at :
> http://dotnethero.com/hero/Dataset/Cache.aspx?nmx=3_4
Isn't the cache global?
So if the data is only pertient to one user, it's easier to store it in a
session variable than in the cache.
Lucas Tam (REMOVEnntp@.rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
[url]http://members.ebay.com/aboutme/
According to what I've read since my last post, the cache is in the
application domain, ie. it behaves like the Application object, not like the
Session oibject, which means there is only one for all the users of the
application. I'm not exactly sure of the difference between the Application
object and the Cache object, but I think the Cache is more efficient -
there's lots of material out there. It was no use to me because it is in the
Application domain.
--
Dave
"Lucas Tam" wrote:
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in news:#UV2KdvpFHA.290
4
> @.tk2msftngp13.phx.gbl:
>
> Isn't the cache global?
> So if the data is only pertient to one user, it's easier to store it in a
> session variable than in the cache.
>
> --
> Lucas Tam (REMOVEnntp@.rogers.com)
> Please delete "REMOVE" from the e-mail address when replying.
> [url]http://members.ebay.com/aboutme/
>
Persisting a dataset between event handlers
this.
I want to read a datset from a database, and display information from one
row at a time, using a Next and a Previous button to navigate through the
dataset.
I read the dataset in the first Page_Load event ie. inside an if
(!IsPostBack) condition, but it is gone again once I get to the button click
event.
Is there no alternative but to reopen the connection and read the entire
dataset every time a button is pushed? Or am I missing something?
--
DaveDave schrieb:
> I want to read a datset from a database, and display information from one
> row at a time, using a Next and a Previous button to navigate through the
> dataset.
> I read the dataset in the first Page_Load event ie. inside an if
> (!IsPostBack) condition, but it is gone again once I get to the button click
> event.
Have you checked that your code is executed in the same request (both the
dataset loading and the button click)?
If you click a button a postback is initiated and you wrote that you load
the database entry only if the request is *not* a postback...
Jan
I don't read the data in the button_click event, I only read it in the
Page_Load event.
If I read the database in the Page_Load event even when it is a postback,
then I read the whole recordset from the database every time the user pushes
a button. My question is, must I do this, or is there a better way.
--
Dave
"Jan Peter Stotz" wrote:
> Dave schrieb:
> > I want to read a datset from a database, and display information from one
> > row at a time, using a Next and a Previous button to navigate through the
> > dataset.
> > I read the dataset in the first Page_Load event ie. inside an if
> > (!IsPostBack) condition, but it is gone again once I get to the button click
> > event.
> Have you checked that your code is executed in the same request (both the
> dataset loading and the button click)?
> If you click a button a postback is initiated and you wrote that you load
> the database entry only if the request is *not* a postback...
> Jan
Dave wrote:
> Is there no alternative but to reopen the connection and read the entire
> dataset every time a button is pushed? Or am I missing something?
Nope. You're not missing anything. CGI programming is stateless. CGI
programming in ASP.NET gives you the ability to hide this fact from
yourself in certain cases, but this is not one of them.
You will need to open a new connection to the database with every
postback to the server. Your page is posting back behind the scenes to
drop you off at that OnClick handler. You'll have access to the
information on the Form, QueryString, Cookies, and Session state.
Hopefully you will have stashed enough information there to enable you
to rebuild your DataSet.
Good luck!
Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com
"=?Utf-8?B?RGF2ZQ==?=" <Dave@.discussions.microsoft.com> wrote in
news:1E22A124-ECFA-449B-A125-1C35BB7B4665@.microsoft.com:
> I read the dataset in the first Page_Load event ie. inside an if
> (!IsPostBack) condition, but it is gone again once I get to the button
> click event.
> Is there no alternative but to reopen the connection and read the
> entire dataset every time a button is pushed? Or am I missing
> something?
If it takes a long time to execute the query, you could store the entire
dataset as a session variable.
--
Lucas Tam (REMOVEnntp@.rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Aargh!
Please don't store datasets in the Session object.
It's far preferrable to use the Cache object for that.
See sample at :
http://dotnethero.com/hero/Dataset/Cache.aspx?nmx=3_4
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
Ven, y hablemos de ASP.NET...
======================
"Lucas Tam" <REMOVEnntp@.rogers.com> wrote in message
news:Xns96BA12F5D238nntprogerscom@.127.0.0.1...
> "=?Utf-8?B?RGF2ZQ==?=" <Dave@.discussions.microsoft.com> wrote in
> news:1E22A124-ECFA-449B-A125-1C35BB7B4665@.microsoft.com:
>> I read the dataset in the first Page_Load event ie. inside an if
>> (!IsPostBack) condition, but it is gone again once I get to the button
>> click event.
>> Is there no alternative but to reopen the connection and read the
>> entire dataset every time a button is pushed? Or am I missing
>> something?
> If it takes a long time to execute the query, you could store the entire
> dataset as a session variable.
>
> --
> Lucas Tam (REMOVEnntp@.rogers.com)
> Please delete "REMOVE" from the e-mail address when replying.
> http://members.ebay.com/aboutme/coolspot18/
Thanks Jason, and eveyone else. That's what I thought. I gather from my
reading that the database engines are pretty good at caching, so there
shouldn't be a huge performance hit.
--
Dave
"jasonkester" wrote:
> Dave wrote:
> > Is there no alternative but to reopen the connection and read the entire
> > dataset every time a button is pushed? Or am I missing something?
> Nope. You're not missing anything. CGI programming is stateless. CGI
> programming in ASP.NET gives you the ability to hide this fact from
> yourself in certain cases, but this is not one of them.
> You will need to open a new connection to the database with every
> postback to the server. Your page is posting back behind the scenes to
> drop you off at that OnClick handler. You'll have access to the
> information on the Form, QueryString, Cookies, and Session state.
> Hopefully you will have stashed enough information there to enable you
> to rebuild your DataSet.
> Good luck!
> Jason Kester
> Expat Software Consulting Services
> http://www.expatsoftware.com
>
Now THAT'S useful information. I realised using the Session object wasn't a
good idea, but I didn't know about the cache object. I'll look for more
information on that. Thanks.
--
Dave
"Juan T. Llibre" wrote:
> Aargh!
> Please don't store datasets in the Session object.
> It's far preferrable to use the Cache object for that.
> See sample at :
> http://dotnethero.com/hero/Dataset/Cache.aspx?nmx=3_4
>
> Juan T. Llibre
> ASP.NET MVP
> http://asp.net.do/foros/
> Foros de ASP.NET en Espa?ol
> Ven, y hablemos de ASP.NET...
> ======================
> "Lucas Tam" <REMOVEnntp@.rogers.com> wrote in message
> news:Xns96BA12F5D238nntprogerscom@.127.0.0.1...
> > "=?Utf-8?B?RGF2ZQ==?=" <Dave@.discussions.microsoft.com> wrote in
> > news:1E22A124-ECFA-449B-A125-1C35BB7B4665@.microsoft.com:
> >> I read the dataset in the first Page_Load event ie. inside an if
> >> (!IsPostBack) condition, but it is gone again once I get to the button
> >> click event.
> >> Is there no alternative but to reopen the connection and read the
> >> entire dataset every time a button is pushed? Or am I missing
> >> something?
> > If it takes a long time to execute the query, you could store the entire
> > dataset as a session variable.
> > --
> > Lucas Tam (REMOVEnntp@.rogers.com)
> > Please delete "REMOVE" from the e-mail address when replying.
> > http://members.ebay.com/aboutme/coolspot18/
>
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in news:#UV2KdvpFHA.2904
@.tk2msftngp13.phx.gbl:
> Aargh!
> Please don't store datasets in the Session object.
> It's far preferrable to use the Cache object for that.
> See sample at :
> http://dotnethero.com/hero/Dataset/Cache.aspx?nmx=3_4
Isn't the cache global?
So if the data is only pertient to one user, it's easier to store it in a
session variable than in the cache.
--
Lucas Tam (REMOVEnntp@.rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
According to what I've read since my last post, the cache is in the
application domain, ie. it behaves like the Application object, not like the
Session oibject, which means there is only one for all the users of the
application. I'm not exactly sure of the difference between the Application
object and the Cache object, but I think the Cache is more efficient -
there's lots of material out there. It was no use to me because it is in the
Application domain.
--
Dave
"Lucas Tam" wrote:
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in news:#UV2KdvpFHA.2904
> @.tk2msftngp13.phx.gbl:
> > Aargh!
> > Please don't store datasets in the Session object.
> > It's far preferrable to use the Cache object for that.
> > See sample at :
> > http://dotnethero.com/hero/Dataset/Cache.aspx?nmx=3_4
> Isn't the cache global?
> So if the data is only pertient to one user, it's easier to store it in a
> session variable than in the cache.
>
> --
> Lucas Tam (REMOVEnntp@.rogers.com)
> Please delete "REMOVE" from the e-mail address when replying.
> http://members.ebay.com/aboutme/coolspot18/
"=?Utf-8?B?RGF2ZQ==?=" <Dave@.discussions.microsoft.com> wrote in
news:66EDD071-8598-4941-8A15-475333E75923@.microsoft.com:
> According to what I've read since my last post, the cache is in the
> application domain, ie. it behaves like the Application object, not
> like the Session oibject, which means there is only one for all the
> users of the application. I'm not exactly sure of the difference
> between the Application object and the Cache object, but I think the
> Cache is more efficient - there's lots of material out there. It was
> no use to me because it is in the Application domain.
Yup, and the OP seemed to want to persist data for a specific user, for a
specific transaction... so the cache object may not be the best place to
(easily) store such data.
--
Lucas Tam (REMOVEnntp@.rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Lucas,
while the data might be pertinent for one user,
it will be pertinent to *every* user that visits the site.
That will result in the dataset being stored in memory
*once for each user* that accesses the page in question.
That might add up to a lot of memory resources.
OTOH, if the Cache object is used, ONE dataset
in memory will serve the needs of many visitors,
saving a lot of memory resources.
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espaol
Ven, y hablemos de ASP.NET...
======================
"Lucas Tam" <REMOVEnntp@.rogers.com> wrote in message
news:Xns96BA5535F58Enntprogerscom@.127.0.0.1...
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in news:#UV2KdvpFHA.2904
> @.tk2msftngp13.phx.gbl:
>> Aargh!
>>
>> Please don't store datasets in the Session object.
>> It's far preferrable to use the Cache object for that.
>>
>> See sample at :
>>
>> http://dotnethero.com/hero/Dataset/Cache.aspx?nmx=3_4
> Isn't the cache global?
> So if the data is only pertient to one user, it's easier to store it in a
> session variable than in the cache.
> --
> Lucas Tam (REMOVEnntp@.rogers.com)
Dave schrieb:
> I don't read the data in the button_click event, I only read it in the
> Page_Load event.
> If I read the database in the Page_Load event even when it is a postback,
> then I read the whole recordset from the database every time the user pushes
> a button. My question is, must I do this, or is there a better way.
You can avoid reloading the data if you include it into the viewstate,
which should be done by default. But now the data will be inserted into the
HTML response twice (one time the visible text and the second time in the
see hidden viewstate input control), so this should not be done if you want
to display large amounts of data from the database.
Jan