Using Visual Studio 2010 SP1, SQL server 2008:
Motherboard recently failed and I migrated all my work to a new computer. My project uses entity data model to connect to a sql database. I had everything set up and working before the migration, but now all of the stored proced开发者_开发问答ures have disappeared from the model browser. The function imports are still there, but they obviously no longer work.
The problem is, when I go to "Update Model from database" the stored procedures do not display. Presumably because they were already added, and the update window hides things that you should already have. The refresh tab doesn't display them either, or do anything when I hit refresh. They still exist on the server, so I know that it is hiding them because it thinks they are already there.
How do I remove whatever causes VS to think they have already been added so I can re-add, or get them to refresh? I really don't want to have to delete the model and start over.
If you don't see function stored procedures in the model browser open EDMX as XML and check if part introduced by <!-- SSDL content -->
contains and Function
elements - that are your stored procedures. Then check that part introduced by <!-- CSDL content -->
contains any FunctionImport
elements - that are your function imports and for last check that part introduced by <!-- C-S mapping content -->
contains andy FunctionImportMapping
elements - that are mappings between procedures and function imports. Each stored procedure you are missing should have exactly one record in each section. If it doesn't have backup your EDMX and remove remaining records for the stored procedure. Then check if it appears in the wizard.
Per request, from my comment on Ladislav's answer, my solve was
No. I am an idiot: the permissions were set only for the account on the old computer. I never set them up for general use because I was still working on them. They werent showing up because I didn't have permissions on them.
Use the entity model browser (right click in edmx designer -> model browser) and browse to stored procedures node.
You can edit or delete them from there
精彩评论