I use Autocompletebox in my asp.net website for load postal code from by sql servr's database. But it take a lot of time (15 second.. to long). And It seem that, if I understand, autocomplete box load ALL my postal code from database and after that, use the string research...
My question is here, did it is possible to call a function sql server with, on parameter, the text witch is written in the Autocompletebox
I've tried a code like :
protected void RadAutoCompleteBox1_TextChanged(object sender, AutoCompleteTextEventArgs e)
string recherche = RadAutoCompleteBox1.Text;
SqlDataSource2.SelectCommand = "select CodePostal,NomCommune from GetVilleByCpTelerik2(" + recherche + ") order by CodePostal OFFSET 10 ROWS FETCH NEXT 10 ROWS ONLY";
But it doesn't work. I have error message like "The object reference is not definied"
Can I have help please ?
Ps : Sorry for my English level