Caching data on local machine

  • Thread starter Thread starter ALPO
  • Start date Start date
A

ALPO

I need to cache a dataset on the client machine and
amnipulate the dataset until the user desires to post the
changes back to the server. ANy help?
 
OK, but how to rebind the grid without a post back? I am
missing something. Whenever I make changes and "click" a
button i re-bind by making a trip to the server. How can
I stop this?
 
Hi ALPO,

Datasets work this way intrinsically, as Miha said. When you want to update
the back end, you will need update commands or a commandbuilder to do so.
If you post your code, we could see if you are missing anything or if
anything is not as it should be.

HTH,

Bernie Yaeger
 
OK, but I need to page through the dataset. Currently
when I page I go back to the server to get the next 5
rows. I need to be able to page back and forth from the
dataset without going back to the db.
 
Aaaa, you are using asp.net I see (I've assumed winforms).
In that case, you can't persist dataset on client machine (actually you can
but you can't access it on client).
I think that you'll have to bind data to (for example) grid -> you have now
data stored on client machine (inside grid).
When client clicks the save button, you should extract somehow the changes
and perhaps, apply them to dataset (if you have previously stored it
somewhere on the server - session cache for example) and do a database
update.

Mayge you should ask in aspnet newsgroup as this is more of a asp.net
problem.
 
OK...thanks for the input.
-----Original Message-----
Aaaa, you are using asp.net I see (I've assumed winforms).
In that case, you can't persist dataset on client machine (actually you can
but you can't access it on client).
I think that you'll have to bind data to (for example) grid -> you have now
data stored on client machine (inside grid).
When client clicks the save button, you should extract somehow the changes
and perhaps, apply them to dataset (if you have previously stored it
somewhere on the server - session cache for example) and do a database
update.

Mayge you should ask in aspnet newsgroup as this is more of a asp.net
problem.

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com





.
 
Hi ALPO,

If you load the entire table into cache, there is no return to the server to
page through the dataset. What makes you believe you are going back to the
server each time you read data from the dataset?

Bernie
 
ASP.NET.......whenever i bind i go back. Unless I am
missing something simple. If you have an example in
ASP.NET of binding without going back to the server,
during paging, for instance. That would be great!
 
hi ALPO,

Like Miha, I had assumed winforms - sorry. No, you can't cache on the local
machine as you can on the windows desktop.

Bernie
 
Ah no. YES, you can cache a DataSet in the Session state. It's easy to do
and works fine--as long as the DataSet is not too large.
That's what you need to do in an ASP page. For applications that don't have
to support 10,000 hits/minute this approach works fine. When the client
clicks on the Update button on the browser-based form, you get a postback.
At this point you re-hydrate the DataSet from the Session cache and move the
data values from the bound controls to the DataRow being changed. (There's a
great article on this in CODE magazine (Nov/Dec). Next, you need to
reconstruct or rehydrate the DataAdapter action queries an execute the
Update method.

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
MVP, hRD
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
Back
Top