Geeks With Blogs

News My Blog has been MOVED to
Michael Freidgeim's OLD Blog My Blog has been MOVED to
I wanted to minimize number of calls to the database, but get back results of dynamic query for small number of columns, as well as detailed data(e.g Itinerary table and Itinerary joined with Itinerary items) .In EntitySpaces
I've created a where condition, filled Query and loaded detailed data, then saved the returned table to DataSet.

Then  for the same query I've specified distinct select columns and Load it again(When LINQ will be available, it could be done in memory without extra database call).  Different table was created, that I've added to the same dataset. Below is code snippet:
                VwItinerariesCollection collPendingList = new VwItinerariesCollection();
                VwItinerariesQuery queryFilter = collPendingList.Query;
                queryFilter.AddWhereConditions();//custom code
                 DataTable tbl= collPendingList.ConvertToDataTable();
                tbl.TableName = "ListWithDetailsTable";   
              DataSet  itineraries = new DataSet();
                 queryFilter.DistinctSelectForList();//custom code
                 tbl = collPendingList.ConvertToDataTable();
                 tbl.TableName = "ListTable";
Posted on Sunday, October 21, 2007 3:01 PM .Net Framework , Code Generation | Back to top

Comments on this post: EnitySpaces: the same Query can be used to save multiple tables

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Michael Freidgeim | Powered by: