Typed DataSets returned as regular datasets

G

Guest

I have a web service that creates several reports, rather than exposing a
method for every report I used something similar to the builder pattern, I
pass in an object that inherits from a base class that holds the parameters
for the report and the method calls a custom report builder that builds a
typed DataSet and then returns a Vanilla Dataset that is actually a reference
to a Typed DataSet. Unfortunately when I get the DataSet back and try to cast
it to its original for, I get an InvalidCastException. Is this a bug or is
this the proper behavior for DataSets? I have subclassed other objects and
used them as parameters for Web Services with out any trouble.
 
C

Cor Ligthert

Jon,

I knew I had seen your question before, and because that I was as well
curious for the answer I have searched the msdn.public.dotnet newsgroups for
it.

You become not happy when you see the first answers, however maybe you can
find an answer that fits you.

http://tinyurl.com/443dc

I hope it helps anyhow something?

Cor
 
G

Guest

Workaround found:

Return the ataSet and then create an instance of the Typed DataSet and then
call the merge method, passing in the DataSet returned from the Web Service.
 

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