Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2005

Tip: Looking for answers? Try searching our database.

DataBinding Web Service Result to DataGrid

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Craig - 20 Jul 2005 14:29 GMT
I'm a newbie to .NET and Web Services so I don't know if what I'm about
to ask is  easy or not as it's all over my head at the moment.

I'm trying to display the response of a web service on an aspx page
using a datagrid like this:-

Private Sub Submit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Submit.Click

    Dim getAvailability As New dialanexchangeavail.IDAEOnlineservice
       Dim AuthID As String
       Dim WebCountryCode As String
       Dim WebRegionCode As String
       Dim Year As Integer
       Dim Month As Integer
       Dim LastDepositID As String

    AuthID = "DEMO-DAE-001"
       WebCountryCode = "A"
       WebRegionCode = "Q"
       Year = 2006
    Month = 11
       LastDepositID = ""

    ' Call the method of the proxy class to initiate the call to the XML
Web service method.

    DataGrid1.DataSource = getAvailability.WSGetAvailability(AuthID,
WebCountryCode, WebRegionCode, Year, Month, LastDepositID)
    DataGrid1.DataBind()

   End Sub

When the button is clicked, you see a wait of about 4 seconds (I'm in
UK, the web service is hosted in Australia) then I get the following
error:-

"An invalid data source is being used for DataGrid1. A valid data
source must implement either IListSource or IEnumerable."

I've read responses on this error in this news group but they don't
relate to web services.  I'm a bit stuck I think.

Any advice would be appreciated.

Regards,

Craig
Jacek Stawicki - 20 Jul 2005 14:41 GMT
It seems that return data from WS are not in acceptable format. The
description of the error is clear:

An invalid data source is being used for DataGrid1. A valid data
source must implement either IListSource or IEnumerable.

You ought to ask supplier of this WS about return data structure .

Signature

C# Dev

> I'm a newbie to .NET and Web Services so I don't know if what I'm about
> to ask is  easy or not as it's all over my head at the moment.
[quoted text clipped - 44 lines]
>
> Craig

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.