SgDotNet
Singapore Professional .NET User Group -For Cool Developers

Returning DataTable in custom object

rated by 0 users
This post has 2 Replies | 1 Follower

Top 10 Contributor
Posts 2,284
icelava Posted: 01-25-2007 11:59 PM

It may seem pretty easy to pass DataSets (with DataTables within) around with .NET web services, but has anybody attempted to embed a DataTable (.NET FW 2.0 makes DataTable serializable on their own) in their custom complex type?

What I am getting at the client side is a proxy class that is the concatenation of <complex type name> + <table's property name in complex type> It has two public exposures: Any - array of XmlElements, and Any1 - a single XmlElement.

The client is .NET based, so how can it try to reconstruct back into a DataTable?

The melody of logic will always play out the truth. ~ Narumi Ayumu, Spiral

Top 10 Contributor
Posts 1,626

.NET 2.0 allows you to expose the DataTable as it is - pretty neat though. The serialization and deserialization were transparent. I didn't have to do anything.

As for me, I usually do not encourage DataTable to be embedded into an entity or complex type. If we are using Entities, we will use the generic list to expose the collection.

 

Software development made easy with Paladin RAD Framework. Save some trees, use Stickies.NET
Top 10 Contributor
Posts 2,284

So there is no way to have the client side recognise and reconstruct a DataTable out of a custom container class?

 Anyway that's indeed what I ended up doing - grouping up the entities into an ArrayList collection before sending out the wire.

The melody of logic will always play out the truth. ~ Narumi Ayumu, Spiral

Page 1 of 1 (3 items) | RSS
Copyright SgDotNet 2004-2008
Powered by Community Server (Commercial Edition), by Telligent Systems