aruni
aruni

Reputation: 2752

How to call stored procedure in Entity Framework?

I'm using ASP.net Entity Framework. So I need to call a stored procedure and want to set a data to DateSet.

This is my function

public DataSet SearchEmployee(string name, string dep)
{
    db.f_t_PEOPLE_SearchEmployee(name, dep);

    return  db.f_t_PEOPLE_SearchEmployee(name, dep);
}

but there is error and it says

Cannot implicitly convert type 'object' to 'System.Data.DataSet'. An explicit conversion exists (are you missing a cast?)

Upvotes: 0

Views: 223

Answers (1)

jlvaquero
jlvaquero

Reputation: 8785

Entity Framework is a ORM. This means that EF maps the data retrieved from BD to classes (objects) wich represents your business entities. I dont know if with some arcane voodoo programming haks you can read a datatable from a SP mapped by EF but what I am sure is that you shouldn't do it. EF was building to avoid DataTables and DataSets.

Upvotes: 1

Related Questions