Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. AutoComplete TextBox

AutoComplete TextBox

Scheduled Pinned Locked Moved ASP.NET
csharpdatabasesysadmintoolshelp
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kirthikirthi
    wrote on last edited by
    #1

    HI all I am trying to create a autocomplete textbox i used this code The code in c# it is working fine but when i convert to VB it is giving error . :) on page load() " acSearch.OnAutoComplete = New Autocomplete.AutoCompleteHandler(Me.GetSearchData)" can any one tell me what i am missing in the code. MY CODE -------------- Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load AjaxPro.Utility.RegisterTypeForAjax(GetType(WebForm1)) acSearch.PageType = Me.[GetType]().BaseType acSearch.OnAutoComplete = New Autocomplete.AutoCompleteHandler(Me.GetSearchData) End Sub _ Public Function GetSearchData(ByVal s As String) As System.Data.DataTable Dim conn As New SqlConnection("server=DSS1;uid=sa;pwd=sa;database=Northwind") Dim cmd As New SqlCommand("SELECT FirstName FROM Employees WHERE FirstName LIKE @FirstName + '%'", conn) cmd.Parameters.Add("@FirstName", s) Dim da As New SqlDataAdapter Dim ds As New DataSet da.SelectCommand = cmd da.Fill(ds, "Employee") Return ds.Tables("Employee") End Function ----------------- Keerthi

    M 1 Reply Last reply
    0
    • K kirthikirthi

      HI all I am trying to create a autocomplete textbox i used this code The code in c# it is working fine but when i convert to VB it is giving error . :) on page load() " acSearch.OnAutoComplete = New Autocomplete.AutoCompleteHandler(Me.GetSearchData)" can any one tell me what i am missing in the code. MY CODE -------------- Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load AjaxPro.Utility.RegisterTypeForAjax(GetType(WebForm1)) acSearch.PageType = Me.[GetType]().BaseType acSearch.OnAutoComplete = New Autocomplete.AutoCompleteHandler(Me.GetSearchData) End Sub _ Public Function GetSearchData(ByVal s As String) As System.Data.DataTable Dim conn As New SqlConnection("server=DSS1;uid=sa;pwd=sa;database=Northwind") Dim cmd As New SqlCommand("SELECT FirstName FROM Employees WHERE FirstName LIKE @FirstName + '%'", conn) cmd.Parameters.Add("@FirstName", s) Dim da As New SqlDataAdapter Dim ds As New DataSet da.SelectCommand = cmd da.Fill(ds, "Employee") Return ds.Tables("Employee") End Function ----------------- Keerthi

      M Offline
      M Offline
      Michael Sync
      wrote on last edited by
      #2

      What error are you getting?

      Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) "Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."

      K 1 Reply Last reply
      0
      • M Michael Sync

        What error are you getting?

        Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) "Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."

        K Offline
        K Offline
        kirthikirthi
        wrote on last edited by
        #3

        Thx For reply The Error is C:\Inetpub\wwwroot\20-3-2006\TextBoxAutoCompletion\WebForm1.aspx.vb(31): 'WebCustomControl.Lab.Autocomplete.AutoCompleteHandler' is a delegate type. Delegate construction permits only a single AddressOf expression as an argument list. Often an AddressOf expression can be used instead of a delegate construction. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load AjaxPro.Utility.RegisterTypeForAjax(GetType(WebForm1)) acSearch.PageType = Me.[GetType]().BaseType acSearch.OnAutoComplete = New Autocomplete.AutoCompleteHandler(Me.GetSearchData) End Sub Keerthi

        M 1 Reply Last reply
        0
        • K kirthikirthi

          Thx For reply The Error is C:\Inetpub\wwwroot\20-3-2006\TextBoxAutoCompletion\WebForm1.aspx.vb(31): 'WebCustomControl.Lab.Autocomplete.AutoCompleteHandler' is a delegate type. Delegate construction permits only a single AddressOf expression as an argument list. Often an AddressOf expression can be used instead of a delegate construction. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load AjaxPro.Utility.RegisterTypeForAjax(GetType(WebForm1)) acSearch.PageType = Me.[GetType]().BaseType acSearch.OnAutoComplete = New Autocomplete.AutoCompleteHandler(Me.GetSearchData) End Sub Keerthi

          M Offline
          M Offline
          Michael Sync
          wrote on last edited by
          #4

          kirthikirthi wrote:

          acSearch.OnAutoComplete = New Autocomplete.AutoCompleteHandler(Me.GetSearchData)

          acSearch.OnAutoComplete = New Autocomplete.AutoCompleteHandler(**AddressOf** Me.GetSearchData)

          Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) "Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."

          K 1 Reply Last reply
          0
          • M Michael Sync

            kirthikirthi wrote:

            acSearch.OnAutoComplete = New Autocomplete.AutoCompleteHandler(Me.GetSearchData)

            acSearch.OnAutoComplete = New Autocomplete.AutoCompleteHandler(**AddressOf** Me.GetSearchData)

            Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) "Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."

            K Offline
            K Offline
            kirthikirthi
            wrote on last edited by
            #5

            Thx Michael Sync It working Keerthi

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups