Strongly typed datasets and web services

P

PeterH

I am developing a web service in VB.Net that returns data from a server.
I have an .asmx page that uses a strongly typed dataset and I would like
to return data in the form of strongly typed data table rows. However I
always get an error message to do with the fact that the data set is not
serializable. For example: "You must implement the Add(System.Object)
method on xyz data table because it inherits from IEnumerable."

The strongly typed data set objects are created automatically in Visual
Studio from the data set schema. Is there a way to force Visual Studio
(2003 version) to implement the necessary methods to make the data set
serializable?

Peter
 
V

vbnetdev

"A class that implements IEnumerable must implement a public Add method that
takes a single parameter. The Add method's parameter must be of the same
type as is returned from the Current property on the value returned from
GetEnumerator, or one of that type's bases. "

That said, support for datatable object in 2003 for what you are trying to
do is not a simple matter. Try returning it back as another dataset (create
it at that end and copy the table) and then returning that dataset. Or
upgrade to VS 2005. Though I have not tested it I have heard this problem
goes away in 2.0.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top