Is there a way for me to pass an additional parameter to the webservice that returns an array of strings for use in an autocomplete textbox?
Basically, I'd like to add an ID field that queries a database for strings that match the ID and the prefixText.
It should look something like this:
[WebMethod]publicstring[] GetAllNames(string prefixText,int count,int resourceId)
{
ArrayList filteredList =newArrayList();SqlParameter[] p = {newSqlParameter("@dotnet.itags.org.intResourceId", resourceId),newSqlParameter("@dotnet.itags.org.strName", prefixText)};
SqlDataReader dr =SqlHelper.ExecuteReader(Common.GetDBConnectionString(),System.Data.
CommandType.StoredProcedure,"prSelectOrganizationPersonnel", p);while (dr.Read()){
filteredList.Add(dr[1].ToString());
}
return (string[]) filteredList.ToArray(typeof(string));}
Thanks!
Hi,sorry, no way to pass additional parameters using the auto-complete stuff at the moment. I can't count the number of times this requirement has been asked, thus I hope the team will provide an improved auto-complete mechanism in the next release.
No comments:
Post a Comment