Let me start by letting you know that I'm still new to VB.
All I know about Programing is with the use of google, Videos, and some good help from DaniWeb.
I'm doing a program which searches datagrid colums with some classes That I have wrote. I have 5 textbox to enter the text to search for and when text is entered it searches for that text .
My question is by having the textchange event reference the class to search for the text I'm woundering if the program will slow down because it it's constantly referencing the same class.
Hope this makes any sence.
Thanks in advance.

5 Years
Discussion Span
Last Post by VIPER5646

A textchange search can take a long time, but this doesn't have to be because you are using classes or the same class for that matter.

If your search is taking a while and it hapens after each keystroke, then you should either plan your search differently or replace the textchange event with a button.

By saying plan your search differently, I mean:
a) Don't connect to a remote server to get the data. Network latency can kill a search.
b) Search with the criteria ordered in your query so that it will have maximum efficiency (if you start eliminating 1 record at a time and your final criteria is eliminating a huge chunk of data, then you are doing it wrong)
c) Create the appropriate indexes.
d) Load your data in a datatable and search it locally. Read here for info on searching a datatable: http://msdn.microsoft.com/en-us/library/y06xa2h1(v=vs.80).aspx

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.