SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 select query in .NET for Searching
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

salmonraju
Yak Posting Veteran

India
54 Posts

Posted - 11/08/2006 :  00:39:50  Show Profile  Send salmonraju a Yahoo! Message  Reply with Quote
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

Sweden
29910 Posts

Posted - 11/08/2006 :  00:44:37  Show Profile  Visit SwePeso's Homepage  Reply with Quote
And BookName LIKE '%sometext%'


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

salmonraju
Yak Posting Veteran

India
54 Posts

Posted - 11/08/2006 :  00:52:52  Show Profile  Send salmonraju a Yahoo! Message  Reply with Quote
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

Sweden
29910 Posts

Posted - 11/08/2006 :  01:56:02  Show Profile  Visit SwePeso's Homepage  Reply with Quote
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
Flowing Fount of Yak Knowledge

2143 Posts

Posted - 11/08/2006 :  06:46:03  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.1 seconds. Powered By: Snitz Forums 2000