Marko Apfel - Afghanistan/Belgium/Germany

Management, Architecture, Programming, QA, Coach, GIS, EAI

  Home  |   Contact  |   Syndication    |   Login
  168 Posts | 2 Stories | 132 Comments | 4 Trackbacks

News



Twitter | LinkedIn | Xing

Article Categories

Archives

Post Categories

BizTalk

C#

Enterprise Library

SAP

SQL Server

Technologie

Problem

If you run the “Generate database from model” wizard and execute the generated script the destination database could be the wrong one (for instance master of the SQL Server).

Solution

To use an own mdf attachable user database some connection information must specified during script execution.

Execute your script opens the dialog “Connect to Server”.

image

Press “Options” and go to the second tab “Connection Properties”.

Select “Browse server” in the “Connect to database” dropdown box:

image

Confirm the information dialog with “Yes”.

In the following dialog you could choose your user database.

image

Now the schema is created in the user database.

posted on Sunday, October 21, 2012 12:35 PM

Feedback

# re: Entity Framework: Connecting to a mdf user database file via localDB during script execution 11/7/2012 4:07 PM melinda
I'm working on my first SQL project and will use these tipps - thanks for the insight.

# re: Entity Framework: Connecting to a mdf user database file via localDB during script execution 12/1/2012 12:35 PM Sarah
I downloaded SQL Server 2012 last week and finally got it running. Thanks for the detailed tips, they will be helpful.

Post A Comment
Title:
Name:
Email:
Comment:
Verification: