I think this may help u
i am not sure
*may be you had to give web methord in List type
<asp:textbox id="TextBox1" runat="server" xmlns:asp="#unknown"></asp:textbox>
<asp:imagebutton id="Search" runat="server" imageurl="~/Images/search_button.png" xmlns:asp="#unknown">
OnClick="Select_TextBox1_AutoCompleteExtende" Style="margin: 2px -10px -11px;" />
<ajaxitem:autocompleteextender id="AutoCompleteExtender1" runat="server" enabled="True" xmlns:ajaxitem="#unknown">
ServiceMethod="GetListofCustomerName" MinimumPrefixLength="1" EnableCaching="true"
CompletionSetCount="2" CompletionInterval="1000" ServicePath="" TargetControlID="TextBox1">
</ajaxitem:autocompleteextender>
</asp:imagebutton>
C#
[System.Web.Script.Services.ScriptMethod()]
[System.Web.Services.WebMethod]
public static List<string> GetListofCustomerName(string prefixText)
{
string cnnString = ConfigurationManager.ConnectionStrings["myConnectionString"].ConnectionString;
MySqlConnection con = new MySqlConnection(cnnString);
MySqlCommand cmd2 = new MySqlCommand("select un from useraccount1 where un like '%" + prefixText + "%'", con);
cmd2.Parameters.Add("prefixText", MySqlDbType.VarChar).Value = prefixText;
MySqlDataAdapter da = new MySqlDataAdapter(cmd2);
DataTable dt = new DataTable();
da.Fill(dt);
List<string> CountryNames = new List<string>();
for (int i = 0; i < dt.Rows.Count; i++)
{
CountryNames.Add(dt.Rows[i]["name"].ToString());
}
return CountryNames;
}
Give me a
Reply if this help's you..