[RESOLVED] How to display (old values) text automatically in text box somthing like MS-Excel cell


Is there a way in .net to display the text automatically when i type the first letter or word in a text box?

I am looking for something like MS-Excel.. In MS-Excel, if the first word is given, automatically it displays the remaining texts, only if values are given previously.




you may use ajaxcontroltoolkit control (Auto Complete).

e.g: http://www.asp.net/ajax/ajaxcontroltoolkit/samples/autocomplete/autocomplete.aspx

i tried retriving values from the database but i am not getting the expected out

could you please help me?

following i smy code

Public Function Getdata1(ByVal text As String, ByVal count As Integer) As String()
        Dim dt As New DataTable
        Dim sql As String = "SELECT ID FROM dbo.products"
        dt = MPClass.FillTable(sql)

          Dim items As String() = New String(dt.Rows.Count - 1) {}
        Dim i As Integer = 0
        For Each dr As DataRow In dt.Rows
            items.SetValue(dr("ID").ToString(), i)
            i += 1
        Return items

    End Function

Public Shared Function FillTable(ByVal sql As String) As DataTable
        Dim conn As SqlConnection = MPClass.GetConnection()
        Dim cmd As New SqlCommand("", conn)
        Dim da As New SqlDataAdapter("", conn)
        Dim ds As New DataSet
        da.SelectCommand.CommandText = sql
        Return ds.Tables(0)
    End Function

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <asp:ScriptManager id="ScriptManager1" runat="server">     

I don't see the ServicePath attribute  for the AutoCompleteExtender.

Here's a nice beginner example


Also you can try JQuery AutoComplete....


And to call WebMethods from JQuery....


In the above resoource, you can write your database logic in the WCF service....


I tried the way mentioned in the link above i am not getting the expected output

I have coopied the code from the  below mentioned link and still didnt get the expected op


could you please help me?

My code is given below

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>


 <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

 <asp:ScriptManager id="ScriptManager1" EnablePageMethods = "true" runat="server"> </asp:ScriptManager>

 <cc1:AutoCompleteExtender ID="AutoCompleteExtender" TargetControlID="TextBox1" ServiceMethod="SearchCustomers"
  MinimumPrefixLength="2" CompletionInterval="100" EnableCaching="false"
  CompletionSetCount="10" runat="server" FirstRowSelected = "false" >


Imports System.Data.SqlClient
Imports System.Collections.Generic

 <System.Web.Script.Services.ScriptMethod(), _
    System.Web.Services.WebMethod()> _
    Public Shared Function SearchCustomers(ByVal prefixText As String, ByVal count As Integer) As List(Of String)
        Dim conn As SqlConnection = New SqlConnection
        conn.ConnectionString = ConfigurationManager _
        Dim cmd As SqlCommand = New SqlCommand
        cmd.CommandText = "select ProdID from dbo.produ where" & _
            " ProdID like @SearchText + '%'"
        cmd.Parameters.AddWithValue("@SearchText", prefixText)
        cmd.Connection = conn
        Dim customers As List(Of String) = New List(Of String)
        Dim sdr As SqlDataReader = cmd.ExecuteReader
        While sdr.Read
        End While
        Return customers
    End Function

conenction string is working fine

pls help me


Hi nicklibee,

Please check the following aspects:

  • The server code is being hit for theweb service?
  • Your query is being executed andreturning results?
  • Your items array is being populatedcorrectly?

    If "nothing" is that none of the above is happening, I would start checking that there are no javascript errors on the page and that your AutoComplete extender is rendering correctly (examine the page controls in a trace).

  • Please check the following link:




    thoughts on "[RESOLVED] How to display (old values) text automatically in text box somthing like MS-Excel cell "

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>