Hi,
I had gone through the link you pasted. From there itself, I got this method name.
Code for my web service which is returning a string array as of now to AutoCompleteExtender is:
using System;
using System.Collections.Generic;
using System.Web.Services;
using System.Data.SqlClient;
using System.Data;
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService]
public class AutoComplete : WebService
{
public AutoComplete()
{
}
[WebMethod]
public string[] GetCompletionList(string prefixText, int count)
{
string str =
SqlConnection conn = new SqlConnection(str);
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = conn;
cmd.CommandText = "Ajax_GetCustomerList";
cmd.Parameters.Add("@customerNameSubString", SqlDbType.VarChar,100).Value = prefixText.ToString();
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds, "customerSubStringList");
string[]chk = new string[ds.Tables[0].Rows.Count];
int i = 0;
ArrayList list = new ArrayList();
foreach (DataRow dr in ds.Tables[0].Rows)
{
chk[i] = dr[0].ToString();
i++;
}
return chk;
}
}
Please assist. Thanks!