0

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?)

1
  • 4
    The whole point of EF is that you don't need to use the old crappy DataSet stuff anymore..... EF works hard to convert relational rows and columns into .NET objects - like a Person or something. So your stored procedure will return a single Person or a List<Person> - not a DataSet..... Commented Apr 30, 2013 at 5:28

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.