Hey Alfredo.
Sorry, went home friday evening before i saw your question.
Array vs. ArrayList
An Array is the least costly, as an ArrayList has alot of built in
functionality which make them much easier to use.
E.g.
with an Array you have to specify the size of it when you instantiate it,
whereas an Arraylist you don't
An ArrayList infact sits between a DataSet and Array in terms of
functionality and overhead.
I often use ArrayLists to get my data initially, then use the
ArrayList.ToArray function to get them to an Array.
I would say these type of objects are better to session than viewstate.
The reason being is the Viewstate can get really big and can slow down the
page load time.
Also, sometimes you get the Infamous Viewstate errors which are painfull to
fix up.
But then again, you don't exactly want to punish your server with sessions,
as that can slow down the whole site and not just a given user on a given
page.
Ultimately, you should be using your Cache (that is for general data, not
client specific - i.e. like a list of countries, not a users answers to a
questionairre)
DataSet from DataGrid
you can get a DataSet from a DataGrid, you'll need to cast its datasource.
Something like
DataSet ds = (DataSet)MyDataGrid.DataSource;
Good luck
"Alfredo Barrientos" <ab*********@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Hi Grant,
An Array or an ArrayList? Which is the least costly?
In Viewstate or session?
Is there any way to get a dataset from datagrid viewstate?
Thanks,
Alfredo Barrientos