First, the question
Using EF codefirst Development, unable to create database problems, the following tips
Server Errorinch '/'application. CREATE DATABASE statements are not allowed within a multi-statement transaction. Description:an unhandled exception occurred during the execution of the current Web request. Please review the stack trace forMore information about the error andwhereIt originatedinchThe code. Exception Details:System.Data.SqlClient.SqlException: The CREATE DATABASE statement is not allowed within a multi-statement transaction. Source Error:line +: */ Line -: PublicZmblogdbcontext (stringnameorconnectionstring) Line the: :Base(nameorconnectionstring) Line *: { line $:
Second, the solution
This is the exception that EF throws, as long as you create the database first.
Create DATABASE [Zmblog]
Tips:
This error occurs when the ABP is first run, and after the database is created, the data is migrated using Update-database, otherwise the underlying data is empty
EF6: CREATE DATABASE statement is not allowed within a multi-statement transaction