Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Issues when binding webdropdown to a webservice
posted

I am using the autocomplete feature of the webdropdown. It works well with a SqlDataSource, however when I bind it to a webservice, the page loads up well. But as I type in the textbox, I get an error which reads

Async request failed

[Exception]: RowFilter is incorrect. at Infragistics.Web.UI.Framework.Data.FilterRecord.ParseRowFilter(String rowFilter)... so on

 

In the Page_Load of my code behind, I have:

         Dim getCities As New GetCities

        WebDropDown3.DataSource = getCities.GetCities2()

        WebDropDown3.TextField = "cty_name"

        WebDropDown3.EnableAutoFiltering = ListControls.AutoFiltering.Server

        WebDropDown3.EnableLoadOnDemand = True

Web Service  Code

 <WebMethod()>

    Public Function GetCities2() As String() 

Dim term As String = Context.Request.QueryString("term")

        Dim cities As New Generic.List(Of String)

        Dim constring As String = "Data Source=(local); Initial Catalog=rereE;User Id=eer;Password=ddd"

        Dim con As New SqlConnection(constring)

        Dim js As New System.Web.Script.Serialization.JavaScriptSerializer

        Try

            con.Open()

            Dim sql As String = "SELECT cty_name,cty_code,cty_zip from city"

            Dim adpter As SqlDataAdapter = New SqlDataAdapter(sql, con)

            Dim ds As DataSet = New DataSet("cities")

            adpter.Fill(ds)

            For Each dr As DataRow In ds.Tables(0).Rows

                cities.Add(dr("cty_name").ToString)

            Next

            con.Close()

        Catch ex As Exception

            Context.Response.Write("Error:" + ex.Message)

        End Try

        Return cities.ToArray

Can some one tell me what is it that I am doing Wrong?.

 

Thanks,

Pradeep