Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Member
37 Points
16 Posts
May 14, 2012 11:16 AM|LINK
@melvintcs
Your function is declared to return an object fo type "List<Model.customer>". It currently returns an object of type "Model.customer"
To return a list change the code:
public static List<Model.customer> GetCustomer(string custID) { Model.customer cust = Data.DAL.GetCustomer(custID); cust.companyName = cust.companyName; //return cust;
//create the list object List<Model.customer> myList = new List<Model.customer>();
//add the customer object to the list. You can add more if you like.
myList.Add(cust);
//return the list return myList; }
fred-dk
Member
37 Points
16 Posts
Re: web services return more than 1 record
May 14, 2012 11:16 AM|LINK
@melvintcs
Your function is declared to return an object fo type "List<Model.customer>". It currently returns an object of type "Model.customer"
To return a list change the code:
public static List<Model.customer> GetCustomer(string custID) { Model.customer cust = Data.DAL.GetCustomer(custID); cust.companyName = cust.companyName; //return cust;