Click here to Skip to main content
15,890,506 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: page authorization Pin
Steven J Jowett24-Jul-08 22:30
Steven J Jowett24-Jul-08 22:30 
GeneralRe: page authorization Pin
Ebube28-Jul-08 23:49
Ebube28-Jul-08 23:49 
QuestionXML Attributes from XML File Pin
Andrew Streetman24-Jul-08 16:11
Andrew Streetman24-Jul-08 16:11 
AnswerRe: XML Attributes from XML File Pin
Mycroft Holmes24-Jul-08 19:40
professionalMycroft Holmes24-Jul-08 19:40 
QuestionHow to search specific record faster Pin
MAP Tiger24-Jul-08 14:08
MAP Tiger24-Jul-08 14:08 
AnswerRe: How to search specific record faster Pin
Guffa24-Jul-08 15:07
Guffa24-Jul-08 15:07 
GeneralRe: How to search specific record faster Pin
MAP Tiger25-Jul-08 1:23
MAP Tiger25-Jul-08 1:23 
GeneralRe: How to search specific record faster Pin
Guffa25-Jul-08 1:48
Guffa25-Jul-08 1:48 
I got the impression that you only did search once, that's why I said that you should search the data directly.

If you want to search the data several times, you should use a dictionary. Finding the key in a dictionary is an operation that is close to O(1), i.e. it takes about the same time regardless if you have 100 items or 100000 items.

If you need to keep the data in the DataTable, you can set up a dictionary to use as index, i.e. use the column value as key, and the row reference or row index as value.

If you need to search different columns, you would need one dictionary per column.

Example creating an index dictionary for a table column:
Dim idx as New Dictionary(Of string, DataRow)(dataTable.Rows.Count);
For Each row As DataRow in dataTable
   idx.Add(row("SomeColumn").ToString(), row)
Next

Once the index is set up, you can find a row instantly:
Dim r As DataRow = idx.Item("Joshua")


Despite everything, the person most likely to be fooling you next is yourself.

GeneralRe: How to search specific record faster Pin
MAP Tiger25-Jul-08 3:26
MAP Tiger25-Jul-08 3:26 
GeneralRe: How to search specific record faster Pin
MAP Tiger25-Jul-08 10:45
MAP Tiger25-Jul-08 10:45 
AnswerRe: How to search specific record faster Pin
Mycroft Holmes24-Jul-08 19:43
professionalMycroft Holmes24-Jul-08 19:43 
GeneralRe: How to search specific record faster Pin
MAP Tiger25-Jul-08 1:15
MAP Tiger25-Jul-08 1:15 
GeneralRe: How to search specific record faster Pin
Mycroft Holmes25-Jul-08 13:39
professionalMycroft Holmes25-Jul-08 13:39 
GeneralRe: How to search specific record faster Pin
MAP Tiger25-Jul-08 13:50
MAP Tiger25-Jul-08 13:50 
GeneralRe: How to search specific record faster Pin
Mycroft Holmes25-Jul-08 15:41
professionalMycroft Holmes25-Jul-08 15:41 
GeneralRe: How to search specific record faster Pin
MAP Tiger25-Jul-08 16:19
MAP Tiger25-Jul-08 16:19 
GeneralRe: How to search specific record faster Pin
Mycroft Holmes25-Jul-08 16:33
professionalMycroft Holmes25-Jul-08 16:33 
GeneralRe: How to search specific record faster Pin
MAP Tiger25-Jul-08 16:45
MAP Tiger25-Jul-08 16:45 
QuestionThreading question Pin
Cory Kimble24-Jul-08 9:23
Cory Kimble24-Jul-08 9:23 
AnswerRe: Threading question Pin
Luc Pattyn24-Jul-08 16:51
sitebuilderLuc Pattyn24-Jul-08 16:51 
QuestionRunning Windows Script on local network Computer Pin
Nerber24-Jul-08 9:01
Nerber24-Jul-08 9:01 
AnswerRe: Running Windows Script on local network Computer Pin
Uros Calakovic25-Jul-08 4:52
Uros Calakovic25-Jul-08 4:52 
QuestionButton inside of a group box Pin
sa_runner24-Jul-08 7:56
sa_runner24-Jul-08 7:56 
AnswerRe: Button inside of a group box Pin
sa_runner24-Jul-08 8:09
sa_runner24-Jul-08 8:09 
QuestionOdd question of the day: In a custom control, how do you get the + sign for nested properties? Pin
Jon_Boy24-Jul-08 4:16
Jon_Boy24-Jul-08 4:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.