Alternative to DataSet

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • RP

    Alternative to DataSet

    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?
  • sloan

    #2
    Re: Alternative to DataSet


    A good alternative is Custom (Business) Objects and a CustomCollectio n.

    http://sholliday.space s.live.com/Blog/cns!A68482B9628 A842A!140.entry

    Check there.

    There is a .Sort method..and a customer comparer as well I think.




    "RP" <rpk.general@gm ail.comwrote in message
    news:759ad196-ec32-4ba7-8362-4bd5b6d5cafd@e6 g2000prf.google groups.com...
    >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?

    Comment

    • RobinS

      #3
      Re: Alternative to DataSet

      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.
      ------------------------------
      "RP" <rpk.general@gm ail.comwrote in message
      news:759ad196-ec32-4ba7-8362-4bd5b6d5cafd@e6 g2000prf.google groups.com...
      >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?

      Comment

      Working...