G
Guest
Hi
Well what i'm trying to do is search text in a datagridview, i've seen
similar code around in other posts or forums, i'm implementing this by using
a Textbox, and the code in the TextChanged event, so when the user keeps
typing, the datagridview must refresh itself showing only the results that
contain the text written so far.
I've seen this in two ways.....checking the text in the rows one by one....
and the other way is using a query, like..
string query = "SELECT * FROM Table WHERE title=" + txtSearch.Text;
and after that execute the query and update the datagridview, something like
that.... but which way to do it has better performance??
mmm another thing, the table has less than 1000 rows.. so maybe it won't
even be a significant difference in time, but still, i'd like to know other
opinions about which way results in a faster, better and easier way to do it
Thanks in advance
Well what i'm trying to do is search text in a datagridview, i've seen
similar code around in other posts or forums, i'm implementing this by using
a Textbox, and the code in the TextChanged event, so when the user keeps
typing, the datagridview must refresh itself showing only the results that
contain the text written so far.
I've seen this in two ways.....checking the text in the rows one by one....
and the other way is using a query, like..
string query = "SELECT * FROM Table WHERE title=" + txtSearch.Text;
and after that execute the query and update the datagridview, something like
that.... but which way to do it has better performance??
mmm another thing, the table has less than 1000 rows.. so maybe it won't
even be a significant difference in time, but still, i'd like to know other
opinions about which way results in a faster, better and easier way to do it
Thanks in advance