<div> <asp:TextBox ID="TextBox1" runat="server" Height="19px" Width="249px"> <asp:AutoCompleteExtender ID="TextBox1_AutoCompleteExtender" runat="server" DelimiterCharacters="" Enabled="True" MinimumPrefixLength="1" ScriptPath="" ServiceMethod="findName" ServicePath="WebService.asmx" TargetControlID="TextBox1"> <br /> <asp:ScriptManager ID="ScriptManager1" runat="server"> </div>
public string[] findName(string prefix) { SqlConnection cn = new SqlConnection("uid=sa;pwd=tatwa;server=192.168.10.19;database=DAMBanking"); cn.Open(); string query = "select * from T_Advisor_Master where Advisor_Name like '" + prefix + "%'"; SqlDataAdapter da = new SqlDataAdapter(query, cn); DataSet ds = new DataSet(); ds.Clear(); ds.Reset(); da.Fill(ds); string[] item = new string[ds.Tables[0].Rows.Count]; int i = 0; foreach (DataRow dr in ds.Tables[0].Rows) { item.SetValue(dr["Advisor_Name"].ToString(), i); i++; } return item; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)