Solved

Ajax AutoCompleteExtender VB.NET

Posted on 2010-11-07
3
757 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
  • 2
3 Comments
 
LVL 12

Accepted Solution

by:
Mohamed Abowarda earned 500 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

838 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