Suggestion on GetMultiAsDataTable()

Posts   
 
    
Posts: 23
Joined: 13-Oct-2005
# Posted on: 13-Oct-2005 16:26:42   

I really like LLBLGen, but had an idea...

I'd like to be able to quickly build a DataTable formatted to receive entities of my choosing. Using GetMultiAsDataTable does that but also fills the table with data. I did try calling with (null, 0, null), but 0 max-records means load all records. Might be nice to have either a new method to create the empty, but formatted DataTable, or perhaps a -1 max-record would mean "no records". Hmm, could create a filter that doesn't match any records, but...

Thanks for your efforts and attention, Bill

bclubb
User
Posts: 934
Joined: 12-Feb-2004
# Posted on: 14-Oct-2005 02:45:17   

CvilleCoder wrote:

I really like LLBLGen, but had an idea...

I'd like to be able to quickly build a DataTable formatted to receive entities of my choosing. Using GetMultiAsDataTable does that but also fills the table with data. I did try calling with (null, 0, null), but 0 max-records means load all records. Might be nice to have either a new method to create the empty, but formatted DataTable, or perhaps a -1 max-record would mean "no records". Hmm, could create a filter that doesn't match any records, but...

Thanks for your efforts and attention, Bill

Bill, Another method that you could use would be too create the columns using the entityfields object and traverse the fields array and add DataColumn objects to the datatable: type is equal to the datatype of the entityfield, name is equal to the field name. You will need to use a normal for loop and not a foreach since the entityfields doesn't implement IEnumerable.

Thanks, Brian