Solved

Ajax AutoCompleteExtender VB.NET

Posted on 2010-11-07
3
755 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
Comment Utility
0
 

Author Closing Comment

by:jeebee75
Comment Utility
ok
0
 
LVL 12

Expert Comment

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

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now