Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

client callback and database traffic

Status
Not open for further replies.

checkai

Programmer
Jan 17, 2003
1,629
US
What I have set up is a client search using client callback...

so basically, after the user has typed in 4 characters, the db starts to get queried on keyup of the textbox...so if i type in

university

i will hit the db 6 times...not sure what type of implications this could have on the db, if any at all...

"...we both know I'm training to become a cagefighter...see what happens if you try 'n hit me..."
 
asp.net and sql are fast flat out.

if you are using onkeyup, you must be using client side code. at what point are you hitting the db and with what function?

If using serverside
string sql = "bla bla";
try creating a stored procedure instead, and in that stored proc use
Code:
SqlCommand myCommand = New SqlCommand("getResults", myConnection);
myCommand.CommandType = StoredProcedure
myCommand.Parameters.Add("@bla",SqlDBType.Varchar,50).Value = "criteria here"

CREATE PROC getResults
   @bla varchar(50)
AS
[b]SET NOCOUNT ON[/b]
   SELECT Bla FROM bla WHERE bla = @bla
[b]SET NOCOUNT OFF[/b]

which will increase your query performance
 
i have the search using a sql stored proc...and threw my testing, it seems that things are quite fast...but i'm just concerned when we start going against the production db...but maybe it's a tiny hit to the db...

"...we both know I'm training to become a cagefighter...see what happens if you try 'n hit me..."
 
If you're really concerned about hits to the db then it would be better (IMHO) to Load the data into a DataSet at the start of the session and then query the DataSet instead of the db on key up.
 
that's a way to go about it as well, i guess...What kind of storage implications for caching a 50,000 record dataset?

"...we both know I'm training to become a cagefighter...see what happens if you try 'n hit me..."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top