Last post May 27, 2008 10:34 AM by Abhishek khanna
May 23, 2008 10:36 PM|qbui66|LINK
I'm not sure if I post this in the right forum or not but I cannot find the WCF web service forum and I don't think this question should be in the Data Presentation forum.
My question is that is it a good practice to send DataSet to the Client using web service? I read some articles mentioned that it's not a good practice.
I'm having this question because in my project, I have to use the web service to send data back and forth between the database and web client.
The web service sends data in DataContract and the web client uses gridview or detailsview to display the data as well as update, insert, delete. So, my gridview or detailsview contains a ObjectDataSource and as far as I know, this only works with DataSet.
So, if we shouldn't send DataSet through web service then what is the best way?
I think I have this answer but I'm not sure if this is the best solution:
Convert the DataContract to the DataTable and then put it in DataSet. And I like to create a Utility method to convert it generically. Is there any other way?
May 27, 2008 10:27 AM|Thomas Sun – MSFT|LINK
The DataSet and DataTable are supported in the data contract model of WCF. WCF data contract model supports certain types that represent XML directly.
You can use these types, consider the following points:
For more information, see
You can ask WCF question on
http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=118&SiteID=1. There are many WCF experts.
I hope this helps.
May 27, 2008 10:34 AM|Abhishek khanna|LINK
Have your Webservice return custom classes this is the best approach.