ASP.NET and Dataset

N

nashak

Hello,

ASP.NET pages are disconnected html pages i.e once page is sent to the
browser, that is it. Let's say that I have a datagrid on my page and I
have used a dataset to fill this grid only during the first visit to
the page. My page loads displaying the data in datagrid. What is the
status of my dataset? Is the dataset stored anywhere when the page got
rendered (I am not caching it)?

Now let's say that I use a button event to modify all the rows of the
datatable inside the dataset. Now since this is a postback, my dataset
is not created. So how does the dataadapter.update method work to
update the status of the rows of the table in a dataset?

I hope I've explained the problem clearly. If not, then please let me
know what information you need and I will try my best to provide it.


Thank you.
 
G

Guest

Nashak,

This is the classic "Cient-side" vs "Server-Side" understanding issue.

The datagrid is a server control that uses the DataSet to render an HTML
Table in your web page. Once the Page class has completed processing and is
extinguished, the web page in the browser is 100% HTML (and possibly some
client script). The dataset is long gone, unless it has been stored in
Session, Application, or Cache.
Hope that helps.
Peter
 
N

nashak

Hello Peter,

Thank you for the response.

Then how does the dataadapter's update method work? I thought that it
looks at each row of the dataset and checks the status to see if it is
inserted, deleted etc and then updates accordingly. That means that the
dataset has to be stored somewhere. I was wondering if we do it
explicitly (like you mentioned) or is it done implictly by ASP.NET

Thanks,
 
G

Guest

Precisely. The DataAdapter is also a server-side animal, and it processes the
dataset on the server-side, in compiled code, just as the original DataSet
was used ,server-side, to populate a DataGrid that eventually rendered as
HTML into the browser on the CLIENT SIDE.

Your web page in the browser has absolutely no knowledge of where it came
from or anything else about what happened on the server, except for the fact
that it may have form elements or possibly client-side XMLHTTP objects that
"point" back to server side code on the server from which it came.

I understand this may be a difficult concept to grasp, but it is critical
that you "get it" through careful study in order to progress as a developer.
Cheers!
Peter



--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top