views:

81

answers:

2

i am getting a list of pagepack assistant by calling a webservice. I have added the web reference.

using org.xerox.xde3.na.sdi.amiller_v_vista;
public org.xerox.xde3.na.sdi.amiller_v_vista.DDCControl proxy;

in page load method i am calling the web method as follows

proxy = new DDCControl();

Guid y = new Guid("45a5b1c2-2fa5-4136-abdd-bc213b694848");

DataList1.DataSource = proxy.GetAllDDCs(this.AccountID, y);

DataList1.DataBind();

I am getting the following error:

An invalid data source is being used for DataList1. A valid data source must implement either IListSource or IEnumerable

public DDCReturnGetAll GetAllDDCs(Guid accountId, Guid authToken);

the return type of GetAllDDCs is DDCReturnGetAll

where

public class DDCReturnGetAll : DDCReturnBase

{ public DDCReturnGetAll();

public DDCInfo2[] DDCs { get; set; } }

where

DDCInfo2 is

public class DDCInfo2 { public DDCInfo2();

public BrandingType brandingType { get; set; }

public string ChargebackName { get; set; }

public string CollectorName { get; set; }

public string Description { get; set; }

public string URL { get; set; } }

Can you please help me with this issue?

+1  A: 

You will need to look at the return type from the procy.GetAllDDCs method and see what it is returning.

The error message you are getting shows that the DataList1 control cannot find a way to enumerate the items for binding.

Mitchel Sellers
+2  A: 

The object returned from GetAllDDCs doesn't implement IListSource or IEnumerable. Most likely the object returned has a property on it that you should bind to instead.

Adam Sills