0

I have domain server with database. When I run aspx page through server, it gives me exception.

Invalid object name 'dbo.Employees'.

In my database Employees table the name don't start with dbo. It start with sky.Employees. I think that this might be the problem.

aspx code behind:

skyfi_PeopleEntities context = new skyfi_PeopleEntities();
            GridView1.DataSource = (from c in context.Employees
                                    select c).ToList();
            GridView1.DataBind();

In this code I think ADO.NET EF works with default dbo. name. The exception may come from here. Is it possible to change from the default dbo. to sky. in the settings of the current skyfi_PeopleEntities. What should I do to fix this problem with the exception ?

theChampion
  • 4,207
  • 7
  • 28
  • 35

1 Answers1

0

I thinks that is because due to invalid connection string, I suggest you also try to call table with simple name.

sky.Employees or dbo.Employees is not the reasons of error.

Can you show your connection string to us. Furthermore also try to call table with simple name (MyTable1) than try sky.Employees

Thanks

taha ahmed
  • 19
  • 6