locked
Autocomplete extender RRS feed

  • Question

  • User478149098 posted

    Hi friends ,

                   My code is execute ,but didnt get result .i cant find the error... i added WebService name in code too

    Asp.net
    
    <form id="form1" runat="server">
            <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
            </asp:ToolkitScriptManager>
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            <asp:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server"  TargetControlID ="Textbox1" ServicePath ="AutoComplete.asmx" ServiceMethod ="GetCompletionList" MinimumPrefixLength ="1" CompletionInterval ="10" EnableCaching="true" CompletionSetCount ="12" CompletionListCssClass="AutoExtender"
    CompletionListItemCssClass="AutoExtenderList" CompletionListHighlightedItemCssClass="AutoExtenderHighlight" CompletionListElementID="divwidth">
            </asp:AutoCompleteExtender>
    
           
        </form>
    
    C#
    
    public DataTable GetRecords(string strName)
        {
    
          
            SqlConnection con = new SqlConnection("Datasouce = XXX;database =ZZZ;Integrated Security = True");
            SqlCommand cmd = new SqlCommand();
            cmd.Connection = con;
            cmd.CommandType = System.Data.CommandType.Text;
            cmd.Parameters.AddWithValue("@Title", strName);
            cmd.CommandText =
            "select PurchasedMaterial from Datesrc where PurchasedMaterial like '"+'%'+@Title+'%'+"'";
            DataSet objDs = new DataSet();
            SqlDataAdapter dAdapter = new SqlDataAdapter();
            dAdapter.SelectCommand = cmd;
            con.Open();
            dAdapter.Fill(objDs);
            con.Close();
            return objDs.Tables[0];
    
        
    }

    Saturday, April 19, 2014 2:01 AM

All replies