Re: ArrayList vs Datatable
If your going to be reading/writing from a database, stick with the datatable. ADO.NET deals with the datatable/dataset objects natively.
Re: ArrayList vs Datatable
ArrayList is slow because everything within it has to be cast as another object before use. A DataTable is slow due to all of its functionality but for what you're doing, I'd imagine a DataTable would be quicker and/or better.
If it's possible I would opt for a custom class that contains all of the data and using something like a List<MyClass> to hold it all and skip the DataSet / DataTable entirely. Of course, if you're going to eventually go into a DataGrid, DataSet or DataTable then it would be a bit pointless to use a class like I suggest.
Re: ArrayList vs Datatable
You've already got your data in a DataTable. You want to build business objects around this data. What possible advantage can you imagine by copying the data to an ArrayList first? If you think that it might be a good idea then you must have some idea of why it might. What do you think?
Re: ArrayList vs Datatable
Wouldn't it be best to first consider how many columns of data will be stored?
I find that if you need to add/remove data at runtime a List will be of benefit, and if you need to store a specific key with something else then a Dictionary or HashTable would be most appropriate. If you had to use a List then i really wouldn't go with LinkedList<T> as List<T> is a little bit better performance wise but again its up to you ;)
Re: ArrayList vs Datatable
. Im using a List<T> because I am going to change(filter) data and not store all the information from the data table.
Thx 4 the replies
Re: ArrayList vs Datatable
Are you aware that the DataTable class already supports filtering via its DefaultView.RowFilter property or its Select method?
Re: ArrayList vs Datatable
While a List<T> may be technically quicker than a DataTable or DataSet due to less overhead, you should factor in the DataTable and DataSet features before making a decision. As jmcilhinney said, the DataTable can do filtering as well.
If your ultimate goal is to display data in a tabular fashion, then stick with the DataTable.