?
Solved

Ajax AutoCompleteExtender VB.NET

Posted on 2010-11-07
3
Medium Priority
?
760 Views
Last Modified: 2012-05-10
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

0
Comment
Question by:jeebee75
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
Mohamed Abowarda earned 1500 total points
ID: 34081101
0
 

Author Closing Comment

by:jeebee75
ID: 34192770
ok
0
 
LVL 12

Expert Comment

by:Mohamed Abowarda
ID: 34193058
Could you please tell me what was unclear in the answer to choose the grade "B"?
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question