Solved

Ajax AutoCompleteExtender VB.NET

Posted on 2010-11-07
3
758 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 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
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 …
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

726 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