1

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.

Kyeotic
  • 19,697
  • 10
  • 71
  • 128

3 Answers3

3

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.

Ladislav Mrnka
  • 360,892
  • 59
  • 660
  • 670
  • I removed the entries for the stored procedures and the functionimportmappings, but they still don't show up in the update window. The names of the stored procedures aren't anywhere else in the edmx file. Is there another place they are stored? – Kyeotic Jun 20 '11 at 19:31
  • No. That looks like some very strange problem with VS. – Ladislav Mrnka Jun 20 '11 at 19:33
  • This doesn't make sense. They are on the server, so VS is choosing not to display them for some reason. It has to be saving them somewhere. – Kyeotic Jun 20 '11 at 19:35
  • If you try to create a new project with new blank EDMX pointing to the database do you see them in the wizard? – Ladislav Mrnka Jun 20 '11 at 19:37
  • 2
    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. – Kyeotic Jun 20 '11 at 19:40
  • @Tyrsius: You should place it as an answer to your question and mark it because that is something many others can found useful. – Ladislav Mrnka Jun 20 '11 at 19:42
  • Are you referring to your original answer or my comment? I marked yours as an answer, I don't know how to mark my own comments as answers. – Kyeotic Jun 20 '11 at 19:53
  • I'm referring to your comment. My post is not the answer to your question - type your comment as an answer to the question and mark it as the answer (you will probably not be able to mark it immediately). – Ladislav Mrnka Jun 20 '11 at 19:55
  • It says I cannot do this, I don't have enough reputation to answer my own question within 8 hours. – Kyeotic Jun 20 '11 at 20:11
  • @Tyrsius I've upvoted this answer, but it wasn't so easy to find the real cause of your problem in comments. This was my problem either. So, thank you for the solution, and maybe you could type your answer as new one? Thanks – Igor Kleinerman Aug 10 '18 at 08:48
1

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.

Kyeotic
  • 19,697
  • 10
  • 71
  • 128
0

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

Baldy
  • 3,621
  • 4
  • 38
  • 60