Alternative to DataSet

R

RP

I have three columns in a Grid (Third-Party), which is populated
through code without using DB DataSource. The columns are: Date,
Amount and Type. At present I created a DataSet to fill the entire
records of the Grid to DataSet DataTable. I need to sort the records
on the basis of Date in the DataTable. To do that I used, DataView and
sorted it and than stored the sorted result in a new DataTable.

I want an alternative of this. Can three columns be stored and sorted
on a particular column if an ArrayList, Dictionary or something is
used?

Which is faster, a DataSet, ArrayList, HashTable or Dictionary?
 
N

Nicholas Paldino [.NET/C# MVP]

RP,

You can figure out which is faster by using the Stopwatch class in the
System.Diagnostics namespace and timing it yourself after performing
like-for-like operations.

Assuming the third party grid you are using supports using custom
objects (the only thing that should be required for data binding is an
implementation of IList), you could create a type that represents the fields
you are showing, and then you should be able to get a collection of those,
populate a BindingList<T> with it, and then bind to that.
 
R

RobinS

It's so easy to sort a dataset. If you use a bindingsource between your
control and the dataset, it will handle the sorting for you.

If you use customer business objects, you have to write your own sort
routines. THis is explained very well in Brian Noyes' Data Binding book.

Why do you not want to use a dataset? Any particular reason?

RobinS.
 

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

Top