none
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

Answers

  • 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


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

    Monday, December 16, 2013 5:32 PM