I would think that it’s obvious how this class should be used, but there’s always a chance that the person reading this article is new to .NET and could use an explanation.
Save the class to a folder in your project and change the Namespace of the class to match the location in your project.
Let’s say that the Web Service provided you with an array of “Persons” ( Person [ ] ). Create a new Person Array:
Person[] personList;
Call the Web Service method that returns the Person Array:
personList = Course.GetPersonList();
Instantiate the downloaded “Object Array” class with the personList:
ObjectArray objectArray = new ObjectArray(personList); Create a DataSet and convert your ObjectArray to a DataSet using the method:
DataSet ds = new DataSet();
ds = objectArray.ToDataSet();
No comments:
Post a Comment