By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,278 Members | 2,358 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,278 IT Pros & Developers. It's quick & easy.

Round-tripping a DataTable through a web service?

P: n/a
Folks,

I need to send a non-strongly typed DataTable as a parameter through my web
service to update the database with the user's changes, and need to return it
to the user's client app with any changes the database/MT made. Most
important: for new records, the client-side ID of "-1" should be replaced
with the database's autoincremented identity value. This DataTable exists on
the client side as the "parent" table in a DataSet, with about four child
tables referencing it.

[And right away: No, I'm not in a position to change everything to custom
objects or strongly-typed DataSets. Thank you, though. Also, I know that I
need to give .TableName a value.]

I've made all this work fine using a local UI, Facade, and MT layers. But
when I introduced a web service layer between the Facade and MT, troubles
began to mount...

A - If I have an expression column in one of the DataTables (which is part
of a larger DataSet on the client), that references another DataTable in the
set, it won't serialize. And from some research I did, it seems that I
couldn't even send the whole DataSet either...

B - Before I could send the DataSet ByVal, and the incremented ID still came
back to my client. Is this not going to happen with web services?

C - If "B" is true, will sending them ByRef work any better?

D - Will I minimize my troubles by sending the whole DataSet, rather than
sending each DataTable piecemeal?
So in general...what do I need to know & do, to round-trip a DataTable
through a web service?

Thanks!
Jun 27 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.