VS 2010 EDMX Stored Procedure Missing

2019-08-04 10:18发布

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 procedures 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.

3条回答
男人必须洒脱
2楼-- · 2019-08-04 10:44

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

查看更多
Lonely孤独者°
3楼-- · 2019-08-04 10:49

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.

查看更多
一纸荒年 Trace。
4楼-- · 2019-08-04 11:04

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.

查看更多
登录 后发表回答