• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 920
  • Last Modified:

WCF Service and Data Contract from DataSet

Hi all,

If I have an operation contract running a DB artifact such as a View or Stored Procedure and it returns back let's say 30 fields yet I only need to return back from the WCF Service (Web Service) call 10 of the 30. Do I have to set up a DataMember for each of those 30 and return back all 30 or can I do the 10 and not apply the other 20?

Does anybody have any good examples or a quality reference site that describes this in detail with a good example?

Any information would be greatly appreciated.

  • 2
1 Solution
If the columns are always the same 10, then from the data set returned from SP, read only the required 10 and send it back.

But if you want to store all the 30 in the data model, and use the same model to send it back, then you have to use the DataMember for the 10 fields you want to send it back
davismAuthor Commented:
jagssidural, that example really doesn't speak much except for how the datacontract used. Especially with the nature of the interface.

apeter, I'm not following what you are saying. Can you explain that more, please?

If anybody have has any information that would be greatly appreciated.

davismAuthor Commented:
Thanks apeter, That information is greatly appeciated.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

7 new features that'll make your work life better

It’s our mission to create a product that solves the huge challenges you face at work every day. In case you missed it, here are 7 delightful things we've added recently to monday to make it even more awesome.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now