1

I have a dynamic stored procedure with two parameters and I can`t add to the model because it has no columns defined.

Any idea how I can get the data into a DataSet.

Tanks

AndresC9
  • 39
  • 3
  • Are you referring to code first in EF 4.1? Can you post your code and give more details of what you are trying to achieve? –  Oct 23 '11 at 07:39

1 Answers1

0

I didn't fully understand what you were after, so I have assumed that you don't know how to pass parameters to stored procedure in EF4.1 Code first.

SqlParameter customerIdParam = new SqlParameter("@customerId", customerId);
Customer customer = context.Database.SqlQuery<Customer>("P_FindCustomer @customerId", customerIdParam).FirstOrDefault();

There was a similar question a while ago.

Community
  • 1
  • 1
  • I think what Andres is saying is that the result set has dynamic column (names or count?), so they can't map the results back to a fixed model (in your example, "Customer"). – Tom Halladay Oct 24 '11 at 12:50