Should I return a strongly typed dataset from a webservice?

.net, data-binding, dataset

Solution

It depends on your interoperability requirements. Although it's entirely possible to process the DataSet XMLs from practically any environment it can get unwieldly. If you're not interoperating I'd definitely recommend the typed dataset route because it's insanely simple to use from C# and "just works".

Problem

Should I expose a strongly typed dataset from a webservice and bind it directly in a client? or are there more sensible ways for asmx web services? I am doing CRUD operations (Create, Read, Update, Delete). I find working with datasets to be frustrating and difficult to work with when for example when inserting into a table within it for instance. It doesn't seem logical to ship a whole dataset to and forth when only inserting one record or when only getting one record from a particular table within the dataset. Is there a better way? Should I perhaps be converting to objects and use objects over the webservice? Doing conversions all over the place to get objects passed around is perhaps just as tedious?

Original source

Related problems