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.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.