Storing results in DataTable

Posts   
 
    
Samee Mir
User
Posts: 6
Joined: 12-Jan-2010
# Posted on: 12-Jan-2010 09:21:40   

hi all,

can any one please tell me that is it possible to store the result in a Datatable using llblgen entity classes and dataaccesslayer. if yes then please let me know...simple_smile

best regards Samee Javaid

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 12-Jan-2010 09:29:25   

If you want to fetch data into a datatable, either use DynamicList or Projection

Samee Mir
User
Posts: 6
Joined: 12-Jan-2010
# Posted on: 12-Jan-2010 11:21:40   

EntityCollection customers = new EntityCollection(new CustomerEntityFactory()); adapter.FetchEntityCollection(customers, null); // fetch all customers // create a view of all customers in germany EntityView2 customersInGermanyView = new EntityView2( customers, (CustomerFields.Country == "Germany"), null ); // create projection of these customers of just the city and the customerid. // for that, define 2 propertyprojectors, one for each field to project ArrayList propertyProjectors= new ArrayList(); propertyProjectors.Add( new EntityPropertyProjector( CustomerFields.City, "City" ) ); propertyProjectors.Add( new EntityPropertyProjector( CustomerFields.CustomerId, "CustomerID" ) ); DataTable projectionResults = new DataTable(); // create the actual projection. customersInGermanyView.CreateProjection( propertyProjectors, projectionResults );

this is the code i get from the above link.. when i try to use the above code in my project it give errors. i-e EntityView2 is not avaliable without the <t> EntityCollection is also not accessible and is giving error.****

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 12-Jan-2010 15:28:05   

Please can you give us the actual, complete text of the error message that you are getting ?

From what you have posted it sounds like you are missing some "using" statements at the top of your class.

ReSharper is a great tool for picking up this sort of problem BTW (it's not free unfortunatly)

Matt