Last post Jan 30, 2014 08:33 AM by galeny
Jan 29, 2014 06:49 PM|BitShift|LINK
I want to use a custom linq query to bring back values from associated entiies and display those in the gridview. Ive typically done this with the ObjectDataSource where I can specify a Selectmethod and a TypeName, which lets me handle
the fetching query code in a method.
With the EntityDataSource I could use the commandtext property and write a query in the markup, but Id rather get some intellisense while writing the query. So that means I should probably use the QueryCreated event and handle it there.
However, it seems like the examples ive seen using this approach rely on a cast, which Im not too fond of (see example here)
So Im wondering if you have a farily complex query to run, is it best to maybe just use ObjectDataSource?
Can someone point me to some examples using EntityDataSource QueryCreated , a custom query to fetch related entity values and a gridview to display them?
Jan 29, 2014 07:02 PM|BitShift|LINK
Well, as I suspected...Im probably better off doing my own binding, as suggested in the thread here
Already doing that in other areas of my app - custom POCO classes and a data access library, then return custom poco classes and bind to those.
Jan 30, 2014 08:33 AM|galeny|LINK