locked
EntityDataSource QueryCreated examples with custom query vs using ObjectDataSource and a Giridview RRS feed

  • Question

  • User853731431 posted

    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?

    Wednesday, January 29, 2014 6:49 PM

Answers

  • User853731431 posted

    Well, as I suspected...Im probably better off doing my own binding, as suggested in the thread here

    http://forums.asp.net/t/1861662.aspx

    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.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 29, 2014 7:02 PM

All replies

  • User853731431 posted

    Well, as I suspected...Im probably better off doing my own binding, as suggested in the thread here

    http://forums.asp.net/t/1861662.aspx

    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.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 29, 2014 7:02 PM
  • User-227760790 posted
    you can provide your codes or markup, in order to help us understand the issue better
    Thursday, January 30, 2014 8:33 AM