Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8188329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:52:27+00:00 2026-06-07T02:52:27+00:00

I m using ajax autocomplete which calls a web service to search name and

  • 0

I m using ajax autocomplete which calls a web service to search name and code(name & code are fields of my datatable)

It works fine

this is my webmothod of webservice

   [WebMethod]
        public string[] GetSupplier(string prefixText)
        {
            con.Open();
            //int count = 10;
            string sql = "Select * from SupplierMaster where name like @prefixText  ";
            SqlDataAdapter da = new SqlDataAdapter(sql, con);
            da.SelectCommand.Parameters.Add("@prefixText", SqlDbType.VarChar, 500).Value = prefixText + "%";
            DataTable dt = new DataTable();
            da.Fill(dt);
            string[] List = new string[100];
            int i = 0;

            foreach (DataRow dr in dt.Rows)
            {
                List.SetValue(dr["name"].ToString(), i);
                i++;
            }

         string sql1 = "Select * from SupplierMaster where codelike @prefixText  ";
            SqlDataAdapter da1 = new SqlDataAdapter(sql1, con);
            da1.SelectCommand.Parameters.Add("@prefixText", SqlDbType.VarChar, 500).Value = prefixText + "%";
            DataTable dt = new DataTable();
            da1.Fill(dt);
            string[] List = new string[100];
            int i = 0;
            foreach (DataRow dr in dt.Rows)
            {
                List.SetValue(dr["name"].ToString(), i);
                i++;
            }
            con.Close();
            return List;

        }

and this is autocomplete extender in .aspx file

  <asp:AutoCompleteExtender runat="server" ID="AutoCompleteExtender3" TargetControlID="txtsear" ServicePath="~/Search.asmx" ServiceMethod="GetSupplier"

 MinimumPrefixLength="1" CompletionSetCount="10" 
CompletionListCssClass="autocomplete_completionListElement"
 CompletionListItemCssClass="autocomplete_listItem" 
                                                                    CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem"
 </asp:AutoCompleteExtender>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T02:52:28+00:00Added an answer on June 7, 2026 at 2:52 am

    I got the answer,

      [WebMethod]
            public string[] GetSupplier(string prefixText)
            {
                con.Open();
                //int count = 10;
                string sql = "Select * from SupplierMaster where name like @prefixText";
                SqlDataAdapter da = new SqlDataAdapter(sql, con);
                da.SelectCommand.Parameters.Add("@prefixText", SqlDbType.VarChar, 500).Value = prefixText + "%";
                DataTable dt = new DataTable();
                da.Fill(dt);
                string[] List = new string[100];
                int i = 0;
                foreach (DataRow dr in dt.Rows)
                {
                    List.SetValue(dr["name"].ToString(), i);
                    i++;
                }
    
                string sql1 = "Select * from SupplierMaster where code like @prefixText";
                SqlDataAdapter da1 = new SqlDataAdapter(sql1, con);
                da1.SelectCommand.Parameters.Add("@prefixText", SqlDbType.VarChar, 500).Value = prefixText + "%";
                DataTable dt1 = new DataTable();
                da1.Fill(dt1);
                //string[] List = new string[dt.Rows.Count];
                //int i = 0;
                foreach (DataRow dr in dt1.Rows)
                {
                    List.SetValue(dr["code"].ToString(), i);
                    i++;
                }
                con.Close();
                return List;
    
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using YUI 2 autocomplete , I have my own web service which
I'm using django-ajax-selects , which is a freely available django app providing jquery autocomplete
I am using this autocomplete Plugin which works great but the problem is $('#request_song').autocomplete({
I am using JQuery autocomplete in one of our web pages which gets source
What's benefit using jQuery Autocomplete over Ajax AutoCompleteExtender? Can some one explains the benefits
I'm trying to write a simple search server, using Django with AJAX. The server
I am using the AJAX autocomplete add-on to the <asp:textbox> control. I have everything
I have an Ajax autocomplete extender, and it is working fine. However, I want
I've tried using merge and extend to combine arrays inside an Autocomplete ajax option
I am trying to create an autocomplete textbox using jquery which will be bound

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.