Solved

Web service result set data binding to a datagrid.

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

789 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