I'm creating some webservices that return a class I created.
This class contains the following:
string datatype;
Object data;
boolean error;
string errormessage;
This works fine when data has types like String, but it doesn't work when it is DataSet.
I get the following error (excerpt):
System.InvalidOperationException: There was an error generating the XML document. ---> System.InvalidOperationException: The type System.Data.DataSet may not be used in this context. To use System.Data.DataSet as a parameter, return type, or member of a class or struct, the parameter, return type, or member must be declared as type System.Data.DataSet (it cannot be object). Objects of type System.Data.DataSet may not be used in un-typed collections, such as ArrayLists.
at System.Xml.Serialization.XmlSerializationWriter.WriteTypedPrimitive(String name, String ns, Object o, Boolean xsiType)
...........
.............
..............
I need this class to be data independent, so i need it to be Object.
Question
OfF3nSiV3
Hello guys!
I'm creating some webservices that return a class I created.
This class contains the following:
string datatype;
Object data;
boolean error;
string errormessage;
This works fine when data has types like String, but it doesn't work when it is DataSet.
I get the following error (excerpt):
I need this class to be data independent, so i need it to be Object.
Thank you
Link to comment
Share on other sites
1 answer to this question
Recommended Posts