0

I am using Database first modal and EF4.0.

I have created a stored procedure which required two input parameters and return dynamically column in result-set i.e. columns are not fixed in result.It may be 5 or 7 or 10 and so on. I am using Grid-view and passing the result-set in it's data-source.

How can i call stored procedure in this case.

thanks.

Sukhjeevan
  • 3,074
  • 9
  • 46
  • 89
  • Stored procedures that return different shapes of results (different number of columns) depending on the input parameters are a BIG design smell - and you basically cannot support this. How should EF know what different shapes of result sets are possible? And which one to use in each case?? You should rearchitect your solution - a stored procedure should **always** return the same result set (at least in its shape - number, name and type of columns). – marc_s Aug 24 '12 at 06:58

1 Answers1

0

You must use ADO.NET and data reader / data adapter directly. EF can work only with stored procedures producing strongly typed results known at design time (you must create class for them).

Ladislav Mrnka
  • 360,892
  • 59
  • 660
  • 670