Edmx fills in mdf?

when I create the database from the model in the edmx file, it queries the data source and generates the sql file and adds the data source to app.config

if I select sqlserver as the source, it works fine and I can either use the existing database or create a new one and the tables will be full and ready to use

is it possible for this sql to somehow fill in the new mdf file?

-- --------------------------------------------------
-- Entity Designer DDL Script for SQL Server 2005, 2008, and Azure
-- --------------------------------------------------
-- Date Created: 08/25/2010 10:41:33
-- Generated from EDMX file: c:\test\test.edmx
-- --------------------------------------------------

SET QUOTED_IDENTIFIER OFF;
GO
USE [test];
GO
IF SCHEMA_ID(N'dbo') IS NULL EXECUTE(N'CREATE SCHEMA [dbo]');
GO

...

works fine with sqlserver, but complains that the database was not found when connecting to sqlexpress and filling in the local mdf file in the project directory <

Do I need to use the connection string from app.config somehow? or first create a database in sql manager? or in any way change the generated sql (possibly from the path of my created mdf)?

Many thanks

+3
2

, .mdf " ". "use [test]" "GO" , .

+3

db, , " " . , SQL , Execute, , MDF.

+1

Source: https://habr.com/ru/post/1757934/


All Articles