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

AutoComplete

Scheduled Pinned Locked Moved ASP.NET
helpdatabasesysadmintoolsquestion
2 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 new to AJAX Methods. I am working on autocomplete Textbox I succeed in 1 textbox autocomplete.But when i try with 2 textbox i got 1 error Error in = "AddressOf SearchAdvanced" Error is : "C:\Inetpub\wwwroot\20-3-2006\TextBoxAutoCompletion\WebForm1.aspx.vb(29): Method 'Public Function SearchAdvanced(Name As String, NameID As String) As System.Data.DataTable' does not have the same signature as delegate 'Delegate Function AutoCompleteHandler(input As String) As System.Data.DataTable'. " MYCODE: ---------- Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load AjaxPro.Utility.RegisterTypeForAjax(GetType(WebForm1)) Autocomplete1.PageType = Me.[GetType]().BaseType Autocomplete1.OnAutoComplete = New Autocomplete.AutoCompleteHandler(AddressOf SearchAdvanced) acSearch.PageType = Me.[GetType]().BaseType acSearch.OnAutoComplete = New Autocomplete.AutoCompleteHandler(AddressOf SearchAdvanced) End Sub _ Function SearchAdvanced(ByVal Name As String, ByVal NameID As String) As System.Data.DataTable Dim ds As New DataSet Dim conn As New SqlConnection("server=DSS1;uid=sa;pwd=sa;database=Time") Dim cmd As New SqlCommand("SELECT Name,NameID FROM IDs WHERE Name LIKE @Name + '%' and NameID LIKE @NameID + '%' ", conn) cmd.Parameters.Add("@Name", Name) cmd.Parameters.Add("@NameID", Name) Try conn.Open() Try Dim da As New SqlDataAdapter(cmd) da.Fill(ds) Finally conn.Close() End Try Catch generatedExceptionName As Exception Return Nothing End Try Return IIf(ds.Tables.Count = 1, ds.Tables(0), Nothing) End Function ----------- Can any 1 help me what is wrong on my code Keerthi

    M 1 Reply Last reply
    0
    • K kirthikirthi

      Hi all I am new to AJAX Methods. I am working on autocomplete Textbox I succeed in 1 textbox autocomplete.But when i try with 2 textbox i got 1 error Error in = "AddressOf SearchAdvanced" Error is : "C:\Inetpub\wwwroot\20-3-2006\TextBoxAutoCompletion\WebForm1.aspx.vb(29): Method 'Public Function SearchAdvanced(Name As String, NameID As String) As System.Data.DataTable' does not have the same signature as delegate 'Delegate Function AutoCompleteHandler(input As String) As System.Data.DataTable'. " MYCODE: ---------- Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load AjaxPro.Utility.RegisterTypeForAjax(GetType(WebForm1)) Autocomplete1.PageType = Me.[GetType]().BaseType Autocomplete1.OnAutoComplete = New Autocomplete.AutoCompleteHandler(AddressOf SearchAdvanced) acSearch.PageType = Me.[GetType]().BaseType acSearch.OnAutoComplete = New Autocomplete.AutoCompleteHandler(AddressOf SearchAdvanced) End Sub _ Function SearchAdvanced(ByVal Name As String, ByVal NameID As String) As System.Data.DataTable Dim ds As New DataSet Dim conn As New SqlConnection("server=DSS1;uid=sa;pwd=sa;database=Time") Dim cmd As New SqlCommand("SELECT Name,NameID FROM IDs WHERE Name LIKE @Name + '%' and NameID LIKE @NameID + '%' ", conn) cmd.Parameters.Add("@Name", Name) cmd.Parameters.Add("@NameID", Name) Try conn.Open() Try Dim da As New SqlDataAdapter(cmd) da.Fill(ds) Finally conn.Close() End Try Catch generatedExceptionName As Exception Return Nothing End Try Return IIf(ds.Tables.Count = 1, ds.Tables(0), Nothing) End Function ----------- Can any 1 help me what is wrong on my code Keerthi

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

      Can you try again with 1 textbox only? Because I don't think that it will work since the signatures are different...

      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."

      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