473,413 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Indexing a datatable column

Hey All!

I would like to create a index to a column in my datatable (full created in
memory). That's because I'll search that column a lot, and this manner I
want to improve the search speedy on that.

How can I create that index?

Ps: I can't use the PrimaryKey property to this case, because that columns
can have duplicate values.
[]s
Cesar


Nov 21 '05 #1
4 5145
Ronchese,
By implementing the hashtable in this you are already there, however can you
show us which search method you did use. There are four to use, did you try
them all?

Cor
Nov 21 '05 #2
Cor,

I'm using the .Select() method of the Datatable, to find the row.

"Cor Ligthert [MVP]" <no************@planet.nl> escreveu na mensagem
news:eE**************@tk2msftngp13.phx.gbl...
Ronchese,
By implementing the hashtable in this you are already there, however can you
show us which search method you did use. There are four to use, did you try
them all?

Cor

Nov 21 '05 #3
Ronchese,

I'm using the .Select() method of the Datatable, to find the row.


The slowest one :-)

Have a look at
Dataview.rowfilter

http://msdn.microsoft.com/library/de...iltertopic.asp

Datarowcollection.find

http://msdn.microsoft.com/library/de...sfindtopic.asp

Dataview.find
http://msdn.microsoft.com/library/de...sfindtopic.asp

I hope this helps,

Cor
Nov 21 '05 #4
Cor,

once the DataView is sorted by a column, is true that it will perform some
quick algoritm to find data in that column? If yes, is what I'm searching.

Cesar

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:uY**************@TK2MSFTNGP10.phx.gbl...
Ronchese,

I'm using the .Select() method of the Datatable, to find the row.


The slowest one :-)

Have a look at
Dataview.rowfilter

http://msdn.microsoft.com/library/de...iltertopic.asp

Datarowcollection.find

http://msdn.microsoft.com/library/de...sfindtopic.asp

Dataview.find
http://msdn.microsoft.com/library/de...sfindtopic.asp

I hope this helps,

Cor

Nov 21 '05 #5

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

Similar topics

3
by: Rich G | last post by:
Hi - can anyone comment on why performance would be so slow to update a DataTable row a simple value? With 3000 rows, it takes 5 seconds, which is unacceptable. Sample code below. Suggestions?...
0
by: Raymond Lewallen | last post by:
I have tried everything to get a newline character into a datatable to no success. I'm trying to add the following to a column in a datatable: sb.append("A") sb.append(ControlChars.NewLine)...
1
by: Job Lot | last post by:
My DataGrid is bound to a datatable named “dtClient” with following columns Date, BalanceCF, Income, Expenses, Withdrawls and BalanceCF. BalanceCF is an expression column. The column Withdrawals...
2
by: Job Lot | last post by:
How can i access all the values in a particular column of a DataTable. How can i then store these values in an array.
2
by: Anita C | last post by:
Hi, How do I associate or map a specific column in a datatable to a particular element present in an xml document - to read into a datatable as well as write from the datatable to the xml element?...
1
by: BStorm | last post by:
Does anyone know the best way to update a DataTable row column using specific values for a multipart primary key? For example, updating an OrderAmt column in an OrderDetail table where the...
1
by: jg | last post by:
I need to create a DataTable object, but I dont want to add columns programatically, the DataTable should have columns based on a Table in my SQL database. How can I create a DataTable with column...
2
by: MattB | last post by:
I know I can use dataviews and more looping to do this, but I'm wondering if there's a more elegant or more concise way to do this. I've got two DataTables with a column called guest_no. I'd love...
1
by: keithb | last post by:
The following code sets a DataTable column DataType to "String" column.DataType = System.Type.GetType("System.String"); What is the corresponding statement when the data type is boolean? I...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...
0
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...
0
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...

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.