Solved

Web service result set data binding to a datagrid.

Posted on 2012-03-19
2
379 Views
Last Modified: 2012-03-19
Hi,

I'm calling a third party web service like:

Exams.ExamBookingService.ExamBookingServiceSoapClient target = new Exams.ExamBookingService.ExamBookingServiceSoapClient();
                GetExamsServiceResponse esr;
               
Where response object is:

[DataContract(Namespace ="http://schemas.homelearningcollege.com/")]
    public class GetExamsServiceResponse    : ServiceResponse
    {

         [DataMember]//
        public List<ExamsDisplay> ExamsDisplay { get; set; }
       
    }

This is what I'm doing in my web form:

                esr = target.GetActiveExams("O6UJ9A001SUJ", "241222576");
                GridView1.DataSource = esr;
                GridView1.DataBind();

And I'm getting the following error:

datasource is an invalid data type. it must be either an IListSource, IEnumarable or IDataSource.

Can anybody advice me please!

Thanks in advance!
0
Comment
Question by:ube100
[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 Comments
 
LVL 7

Accepted Solution

by:
markmiddlemist earned 500 total points
ID: 37739926
Try setting DataSource = esr.ExamsDisplay as that's the actual collection
0
 

Author Closing Comment

by:ube100
ID: 37739931
You are star boy. Thanks you!!!
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

623 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