473,651 Members | 2,937 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Alternatives to DataTable

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
2 6808
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.co m
"Guadala Harry" <GM**@NoSpam.co m> wrote in message
news:%2******** ********@TK2MSF TNGP15.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
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.co m
"Guadala Harry" <GM**@NoSpam.co m> wrote in message
news:%2******** ********@TK2MSF TNGP15.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
10056
by: Stefan Turalski \(stic\) | last post by:
Hi, I'm wondering if there is a way to send a method parametrs by ref when DataTabel is a type of this value ? I done some sort of select over DataTable columns, just by removing them froma table is each of them isn't on a stirng, but right no I have to do it in a wat of: 1. passing DataTable to method (lets call it SelectOverDataTabel) 2. declare a local (in SelectOver...) DataTable, inicialize it with my value
7
1769
by: Tinus | last post by:
Hello all, I was wondering... Is there a way to create a Array so that I can call a value with a name i.s.o. a index number? Something similar like a DataTable. This is what I want: Declare a array of some sorts, private string test; .... I don't want to get the value by saying: test but test Can this only be done with a DataTable? But DataTables are for databases
0
3142
by: Chris Ericoli | last post by:
Hi, I am working with an 'in session' ado dataset with an asp.net application. My dataset is comprised of two tables, one of which maintains a few calculated datacolumns. For some reason these datacolumns do not trigger their expression when other columns from which the expressions are derived are updated. Below is a basic example of what I am doing. User enters values into an asp.net form and clicks a button. Retrieve dataset from...
7
1657
by: Raymond Lewallen | last post by:
Which would be the proper way or the reason for using any of the following or combinations of the following? These are the 3 ways I've figured I can do what I want to do, I just don't know which would be best: #1 ' Everything is create upon instantiation. Once completed, datatable can be obtained from the property. Public Class A Private dt as DataTable
3
4214
by: Gene Hubert | last post by:
I'm using DataTable.ImportRow to move data from one datatable to another... Dim dt, dtTarget As DataTable Dim dr As DataRow dt = DirectCast(Me.DataSource, DataTable) dtTarget = dt.Clone 'copy the data structure dtTarget.DefaultView.Sort = String.Empty 'remove the sort
11
1787
by: Geoff | last post by:
Hi I have a DataTable with thousands of rows. I want a quick way to insert the rows into a table in an Access database with the same structure. I have been using an update command but found it to be very slow i.e. there are about 100,000 rows of data. Can anybody suggest a quick way to do it? Geoff
2
2650
by: pagates | last post by:
Hi All, I have a DataTable in a Windows Forms project that I would like to use a Select statement. The problem is, I'd like to be able to do wildcard searches (including single charcater searches). What are my alternatives? I'd rather not have to go back to the database, unless that is the best way. The DataTable was a performance enhancement. Thanks,
5
2000
by: jehugaleahsa | last post by:
Hello: I am trying to find what is the very best approach to business objects in Windows Forms. Windows Forms presents an awesome opportunity to use DataTables and I would like to continue doing so. I have worked with dynamically generated DataTables with customized DataRows. However, these classes are usually pretty limited. For instance, you are limited to a select few data types and you can't deal with nulls as well as desired (in...
5
5889
by: jehugaleahsa | last post by:
Hello: What is the point of using a DataTable in ASP .NET? We are unsure how you can use them without 1) rebuilding them every postback, or 2) taking up precious memory. We are not sure how to store a DataTable in any other way outside of our servers. In doing so, we leave ourselves open to large memory requirements. Furthermore, most web pages do not really support multiple changes per transaction. In other words, when the user submits...
0
8277
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8803
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8700
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8581
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6158
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4144
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4285
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2701
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1588
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.