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