how to call dynamic sp form entityframwork. RRS feed

  • Question

  • Dear All,

     I am using entity frame work of vs - 2012, to show reports using linq to entity.

    Now i want to use dynamic stored proc.

    Please tell me how to call stored proc from entity. Situation is the col number and type can vary because it is dynamic.


    Yours sincerely

    Monday, December 16, 2013 4:16 PM


  • You can use your DbContext.Database.Connection to run an arbitrary query and return un-typed results using ADO.NET DataReader or DataTable.

    Or you can define a type in your project for the shape of the results and use DbContext.Database.SqlQuery.


    David http://blogs.msdn.com/b/dbrowne/

    • Proposed as answer by Fred Bao Tuesday, December 17, 2013 3:22 AM
    • Marked as answer by Fred Bao Wednesday, December 25, 2013 9:03 AM
    Monday, December 16, 2013 5:32 PM