473,698 Members | 2,557 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Datatable find performance

Anybody know for sure if the data table find is faster than building a loop
routine. I'm thinking the find is syntactic sugar because it can't really
build an index table can it? But then again what is the primary key for if
it doesn't really build a table. I suspect it is more for filling the
datakeys and isn't really related to the index. But then again...

--
Regards,
Alvin Bruney
Got tidbits? Get it here...
http://tinyurl.com/3he3b
Nov 18 '05 #1
2 1194
If you grab a copy of .NET Reflector, you can actually take a look at the
decompiled source of the Framework Class Library. The FindRow(...) method
does, indeed. work with indexes, and it's not a mere loop iteration. It also
leads to shorter, more readable code.

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"Alvin Bruney" <vapor at steaming post office> wrote in message
news:uw******** ******@TK2MSFTN GP12.phx.gbl...
Anybody know for sure if the data table find is faster than building a
loop
routine. I'm thinking the find is syntactic sugar because it can't really
build an index table can it? But then again what is the primary key for if
it doesn't really build a table. I suspect it is more for filling the
datakeys and isn't really related to the index. But then again...

--
Regards,
Alvin Bruney
Got tidbits? Get it here...
http://tinyurl.com/3he3b

Nov 18 '05 #2
Thanks. I know it leads to shorter code, I just didn't know that it was more
than syntactic sugar. Thanks for heads up. Gotta start rewriting code now...

--
Regards,
Alvin Bruney
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Chris Jackson" <chrisjATmvpsDO TorgNOSPAM> wrote in message
news:OL******** ******@TK2MSFTN GP11.phx.gbl...
If you grab a copy of .NET Reflector, you can actually take a look at the
decompiled source of the Framework Class Library. The FindRow(...) method
does, indeed. work with indexes, and it's not a mere loop iteration. It also leads to shorter, more readable code.

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"Alvin Bruney" <vapor at steaming post office> wrote in message
news:uw******** ******@TK2MSFTN GP12.phx.gbl...
Anybody know for sure if the data table find is faster than building a
loop
routine. I'm thinking the find is syntactic sugar because it can't really build an index table can it? But then again what is the primary key for if it doesn't really build a table. I suspect it is more for filling the
datakeys and isn't really related to the index. But then again...

--
Regards,
Alvin Bruney
Got tidbits? Get it here...
http://tinyurl.com/3he3b


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
8118
by: Luc | last post by:
I am using Visual Studio 2003 and am getting lousy performance after using a datatable select and then trying to assign a value to a column of the row that was found: DataTable dt = new DataTable(); dt.Columns.Add("Number", System.Type.GetType("System.Int32")); dt.Columns.Add("Value", System.Type.GetType("System.Double")); for(int i=0;i<2000;i++) {
6
1757
by: Mountain Bikn' Guy | last post by:
When one gets a row from a database (ie, a DataTable), the row contains a typed value in each column. How is this typically implemented behind scenes. I want to build this functionality myself. The reason I want to do this is because I need an in-memory table without any of the overhead of a DataSet or DataTable. Thanks!
1
12706
by: Matthew Wieder | last post by:
I'm finding that the AddRange call in the following code takes several seconds to execute (approx. 4 seconds). DataColumn adcCols = new DataColumn; for (int i=0; i<adcCols.Length; i++) { adcCols = new DataColumn(); } myDataTable.Columns.AddRange(adcCols);
3
5903
by: nandan | last post by:
Hi, Has any one ever compared the performance of calling a DataTable's Select method with a stored procedure doing the same thing? My point is: dataRows = DataTable.Select(filter) is better or Passing paramters to stored procedure? The datatable holds about 500-700 rows at any given time. If I select one of the approaches the business logic will go into respective layers.With dotnet in picture what would be a good approach
9
1710
by: VMI | last post by:
We have this huge application that's based on storing tons of data on a dataTable. The only problem we're having is that storing LOTS of data (1 million records) into a datatable will slow down the system since all this data will be stored in memory. The performance is really affected with this. Since we don't really want to redesign everything based on this datatable, are there any companies that offer a product similar to the datatable...
2
6828
by: Guadala Harry | last post by:
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...
2
4396
by: Larry Smith | last post by:
Hi there, Can anyone comment on the performance issues of "DataTable.Select()" vs "DataView.Find()" (or "DataView.FindRows()"). I have to conduct repeated searches using the same index and I'm not sure which to rely on. From what I've read, "DataTable.Select()" doesn't rely on indexes so using a "DataView" would seem to be the obvious choice. However, that still requires the index be built each time I construct a new "DataView". Given...
1
30065
by: Dave | last post by:
Hello, What is the best way (performance wise) to search for a row in a table? Let say I have a column named "col1" and what to get the row that the value of "col1" is "It is me"... I can set this column as the primary key to use the find method if it worths it. So my options are: 1- using the DataTable.Select method and provide a criteria like "col1 = 'It is me'" 2- creating a primary with "col1" and use the DataTable.Rows.Find("It is
5
5894
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...
3
4895
by: fniles | last post by:
Can I create an index on a DataTable ? On the following DataTable, I would like to create index on "Price", can I do that ? Thank you. Dim DT As New DataTable DT.Columns.Add("Price", GetType(System.Int32)) DT.Columns.Add("ID", GetType(System.Int32)) DT.Columns.Add("Vol", GetType(System.Int32))
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8610
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
9170
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
9031
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
8873
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...
0
5862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4372
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...
1
3052
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
2339
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.