Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 select query in .NET for Searching

Author  Topic 

salmonraju
Yak Posting Veteran

54 Posts

Posted - 2006-11-08 : 00:39:50
I am writing a .net application it contains database with some information about books
say table lke this

BooKID BookName BookCategeory Edition
54 computers Education 2nd
23 SportsStar Sports 1st
22 The Holy Bible Spirutual

Now i need to Search the books according to user interest
if user selects the SEARCH BY NAME and(also some Categeory) option to search.
i wrote command like this

select * from Books Where BookCategeory='Education' and BookName like
'sometext%'

in key_up event of TextBOX

is this is the right way to search if there are more no of records will it disgrade performance
because for every key press it will communicate with database
how far it is better
or I need to go for other

please suggest me


SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-11-08 : 00:44:37
And BookName LIKE '%sometext%'


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

salmonraju
Yak Posting Veteran

54 Posts

Posted - 2006-11-08 : 00:52:52
Thank u
Will it show bad performance on my application,because on every key up event
this process will be invoked
is this the right procedure normally people chosse to search
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-11-08 : 01:56:02
It will not be as fast as the original query because the query can not optimize an index to use.
Depending on the number of records, the end result can vary from 1/10th of a second to several second.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2006-11-08 : 06:46:03
do a google search for "Autocomplete dropdown list".
You will return your data ALL at once, but display just what the user wants to see.

[Signature]For fast help, follow this link:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx
Learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page
   

- Advertisement -