Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> Retrieving TypedViews from a WebService/WCF supplied DataTable
 

Pages: 1
LLBLGen Pro Runtime Framework
Retrieving TypedViews from a WebService/WCF supplied DataTable
Page:1/1 

  Print all messages in this thread  
Poster Message
JSobell
User



Location:

Joined on:
07-Jan-2006 06:44:46
Posted:
89 posts
# Posted on: 04-Mar-2009 22:29:59.  
I started looking into how I might 'cast' or convert a DataTable (that you *know* came from a specific TypedView) back into an instance of the TypedView without duplicating it.
You can do it as follows:
MyStuffTypedView tv = new MyStuffTypedView();
DataTable dt = client.GetAnExternalDataTable();
tv.Load(dt.CreateDataReader());
This is obviously cloning the returned one as opposed to 'wrapping' it, but I presume this is the only option as TypedViews inherit from DataTable rather than referencing them.

I'm looking at this as a simple way of returning tables of data from WebService calls. There's not much in the help about TypedViews over WCF/SOAP, so is there a better or 'more correct' way to do this?
I know that a DataSet is sometimes not the most efficient data object due to all the metadata included, but the simplicity of having LLBLGen's object wrap it saves Fields*Views*x lines of hand-written code in each project and retains the nice custom additions and properties in the Adapter client code.
I suppose we could write a template to generate 'lightweight' objects to pass around for views, but as these would typically be in the same project as our TypedView object it seems a bit pointless Regular Smiley

Cheers,
Jason
  Top
daelmo
Support Team



Location:
Guatemala City
Joined on:
28-Nov-2005 23:35:24
Posted:
8108 posts
# Posted on: 05-Mar-2009 05:24:40.  
Hi Jason, have you tried to set the TypedView2 in the contract and send/receibe it ?

David Elizondo
LLBLGen'ing (articles and code snippets) | linkedin | twitter
 
Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.