473,387 Members | 1,455 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

DataBinding Web Service Result to DataGrid

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

Nov 19 '05 #1
1 3273
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 .

--
C# Dev
"Craig" wrote:
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

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: CGuy | last post by:
Hi, I have an ASPX page which has a datagrid and this datagrid is bound to a Custom Collection. sample code this.DataGrid1.DataSource = UserManager.Users; this.DataGrid1.DataBind();
0
by: Jason S | last post by:
I haven't been able to get an answer to this in the asp.net group, hoping someone here can enlighten me. As pertains to databinding a control in a repeating fashion(datagrid, repeater, etc.)...
3
by: MajorTom | last post by:
Hello I need help. I have a datagrid that have a dataview as datasource. in the keyup event of one textbox I use dataview.rowfilter = some.text; when the condition of my rowfilter return...
1
by: oafyuf | last post by:
Hi, I'm trying to learn ASP.NET by doing a pilot project: I have a DataGrid which contains a nested DataList. I want to iterate through the SQLDataReader for the DataGrid and populate each...
3
by: Luis Esteban Valencia | last post by:
Hi, the following code displays a search result in a datagrid and is working without problems. But I think the way I have done is not correct especially databind(). could anyone help me to...
8
by: Jeff | last post by:
Hi - I'm having trouble Databinding a SQLDataReader to a DataGrid control. I have an ASP.NET web page accessing a SQL database. I've used VS to build the app and stored it in a directory of...
4
by: Nathan Sokalski | last post by:
I have two databinding expressions (the first & last names from a DB) that I want to assign to the text property of a Label so that the result is LASTNAME,FIRSTNAME. At the moment, I have the...
7
by: BS | last post by:
Hello everybody I'm calling a webservice that returns complex data. The goal is to populate a datagrid with it. Using a loop for each record found ( such as For i = 0 To...
8
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.