Link to home
Start Free TrialLog in
Avatar of jeebee75
jeebee75Flag for New Caledonia

asked on

Ajax AutoCompleteExtender VB.NET

Hi, I use a autocompleteextender for a multiline textbox and it doesn't work but the debug won't show me any errors.
Thks for youtr help
aspx

<asp:ToolkitScriptManager ID="ScriptManager1" runat="server">
                                <Services>
                                    <asp:ServiceReference Path="MyService.asmx" />
                                </Services>
                            </asp:ToolkitScriptManager>
                            <asp:TextBox ID="txtDescAdd" runat="server" Width="537px" Height="111px" TextMode="MultiLine"></asp:TextBox>
                            <asp:AutoCompleteExtender runat="server" ID="autoComplete1" TargetControlID="txtDescAdd"
                                ServicePath="MyService.asmx" ServiceMethod="GetDescription" MinimumPrefixLength="1"
                                EnableCaching="true" />


asmx.vb

    Public Function GetDescription(ByVal prefixText As String, ByVal count As Integer) As String()
        Dim strSql As String = ("SELECT top " + count + " id_ts, description from timesheet where id_user = " + ADTools.GetUserID(My.User.Name).ToString + " and description like '" + prefixText + "%'")
        Dim conn = New SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionTS").ConnectionString)
        Dim command = New SqlCommand(strSql, conn)
        Dim reader As SqlDataReader = command.ExecuteReader
        Dim temp As New List(Of String)
        While reader.Read
            temp.Add(CType(reader("description"), String))
        End While
        conn.Close()
        Return temp.ToArray()
    End Function
End Class

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Brad Brett
Brad Brett
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jeebee75

ASKER

ok
Could you please tell me what was unclear in the answer to choose the grade "B"?