Solved

Web service result set data binding to a datagrid.

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now