Solved

Web service result set data binding to a datagrid.

Posted on 2012-03-19
2
377 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

759 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