hello everyonei am very new to web services. and i am having a problem returning a collection of custom object from a web method
i have a windows forms application and a web service. the web service contains of two classes . one is 'School' other is a collection of 'School' called 'Schools' which is inherited from CollectionBase. the code for those two classes are as follows
public
[
here is the code in the windows form
Instead of returning Schools collection if i return School Object it works fine. i have changed my web method and windows forms coding as following
[WebMethod]public School GetSchoolList() { School school = new School(); school.SchoolName = "School " ; school.Address = "Address " ; return school;}
private void FrmManageSchools_Load(object sender, EventArgs e){ // web service RegisterSchool rg = new RegisterSchool(); // here the school object is available and i can get the data success fully School myschool = new School(); myschool = rg.GetSchoolList();}
i have tried a lot , but couldnt get to return the Schools collection. guyz please help me with this.
thank u