By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,543 Members | 1,887 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,543 IT Pros & Developers. It's quick & easy.

Alternatives to DataTable

P: n/a
The current implementation (that works) retrieves data from a SS2K db via
stored procedure that returns 40-60 rows and 6 columns (one string and five
int columns), and places that result set into a DataTable that remains in
the Application State (this is an asp.net web application). Various methods
throughout the app read this DataTable - searching for one specific row and
then specific column(s) within the found row. While everything works, I'm
looking to verify that I have (1) considered all reasonable alternatives and
(2) implement the solution with fastest expected performance.

Elsewhere in the application, I have implemented ListDictionary and
HashTable collections with great results. Those structures work great for
name/value pairs that can be retrieved based on a single key value. But the
result set in question contains 6 columns, and searches for specific rows
are based on 2 or 3 columns (currently accomplished using the DataTable's
Select method). Given the need to find a row based on more than one value, I
can't simply retrieve the desired row based on a single key value like I can
with a hash table.

So, what are my alternatives to the DataTable? Or would you recommend
sticking with it?

Thanks!

Nov 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Guadala,

Since the set is small, you might be able to use HashTables to keyed
properly to cover all of your selection criteria, but if you ever needed to
add a column, the unwieldy nature of the solution would make it quite
unmaintainable, IMO. I would recommend sticking with the DataTable, as it
would be easier to maintain in the future, should you have to make changes.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Guadala Harry" <GM**@NoSpam.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
The current implementation (that works) retrieves data from a SS2K db via
stored procedure that returns 40-60 rows and 6 columns (one string and
five
int columns), and places that result set into a DataTable that remains in
the Application State (this is an asp.net web application). Various
methods
throughout the app read this DataTable - searching for one specific row
and
then specific column(s) within the found row. While everything works, I'm
looking to verify that I have (1) considered all reasonable alternatives
and
(2) implement the solution with fastest expected performance.

Elsewhere in the application, I have implemented ListDictionary and
HashTable collections with great results. Those structures work great for
name/value pairs that can be retrieved based on a single key value. But
the
result set in question contains 6 columns, and searches for specific rows
are based on 2 or 3 columns (currently accomplished using the DataTable's
Select method). Given the need to find a row based on more than one value,
I
can't simply retrieve the desired row based on a single key value like I
can
with a hash table.

So, what are my alternatives to the DataTable? Or would you recommend
sticking with it?

Thanks!

Nov 16 '05 #2

P: n/a
Guadala,

Since the set is small, you might be able to use HashTables to keyed
properly to cover all of your selection criteria, but if you ever needed to
add a column, the unwieldy nature of the solution would make it quite
unmaintainable, IMO. I would recommend sticking with the DataTable, as it
would be easier to maintain in the future, should you have to make changes.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Guadala Harry" <GM**@NoSpam.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
The current implementation (that works) retrieves data from a SS2K db via
stored procedure that returns 40-60 rows and 6 columns (one string and
five
int columns), and places that result set into a DataTable that remains in
the Application State (this is an asp.net web application). Various
methods
throughout the app read this DataTable - searching for one specific row
and
then specific column(s) within the found row. While everything works, I'm
looking to verify that I have (1) considered all reasonable alternatives
and
(2) implement the solution with fastest expected performance.

Elsewhere in the application, I have implemented ListDictionary and
HashTable collections with great results. Those structures work great for
name/value pairs that can be retrieved based on a single key value. But
the
result set in question contains 6 columns, and searches for specific rows
are based on 2 or 3 columns (currently accomplished using the DataTable's
Select method). Given the need to find a row based on more than one value,
I
can't simply retrieve the desired row based on a single key value like I
can
with a hash table.

So, what are my alternatives to the DataTable? Or would you recommend
sticking with it?

Thanks!

Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.