0

I have a simple bunch of problems and with a ridiculous timeline and I just ate away over an hour trying to get the database up and running.

I have with me an asp.net-mvc project which has a bunch of Models in code-first. Was given over to me my someone. He used MvcScaffolding and I had nice repositories for each Model and and forms for CRUD already.

The problem is the data is currently temporary. Now I added a connection string into the web.config like Eriks article says here. It created an sdf database. But I cannot open this in VS or Sql Mgmt Stdio. It gives me :

The given key was not present in the dictionary

When I also add a database from within visual studio server explorer and/or the solution explorer gives me the same thing.

I also tried creating the Db with some schema in SQL Mgm Studio but when I try to create and EF model in VS it says the same thing!

Is there any other quicker option I have now? I tried SQL Server, but thats always a pain to connect to across my other co-workers.

Is there a library/tool that can take my Models and create some schema with an entity framework model that I can edit with the designer? I can't seem to envision which models/tables go where and there aren't any relationships between them yet.

I'm using Entity-Framework4 and VS2010 with asp.net-mvc3/razor.

2

1 Answer 1

1

Let me google that for you: http://hestia.typepad.com/flatlander/2010/08/fixing-the-server-explorer-the-given-key-was-not-present-in-the-dictionary-error.html

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

2 Comments

Hey thanks erik. I did look at that msdn articles about creating a new user account. This may sound silly but is it creating a new windows a/c. I just thought that solution was vague!. Anyway, the article you pointed is about removing a dud connection string. I instead wanted to create the EF (edmx) model since I've never done code first.
+1 Tell me tho, currently, with just the code models and a DBContext, the data is getting stored somewhere temporarily. Where is that? Is the Db getting created and then deleted?

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.