Ich habe gerade eine neue Anwendung in ASP.Net MVC 4 bereitgestellt. Ich verwende einen SQL Server 2008 R2 (NICHT SQL Express).Fehler beim Erstellen der SQL Server Express-Datenbankdatei in MVC 4 - aber ich möchte SQL Server Express NICHT verwenden
Es funktionierte gut für die ersten 10 Minuten, dann habe ich eine kleine Änderung im Code und re-deployed es. Jetzt
, wenn ich versuche, auf eine Seite zuzugreifen, die SimpleMembership verwendet, bekomme ich diesen Fehler:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
SQLExpress database file auto-creation error:
The connection string specifies a local Sql Server Express instance using a database location within the application's App_Data directory. The provider attempted to automatically create the application services database because the provider determined that the database does not exist. The following configuration requirements are necessary to successfully check for existence of the application services database and automatically create the application services database:
Aber ich nicht Verwendung von SQL Server Express. In meinem web.config
Ich habe alle Verbindungszeichenfolgen wie folgt festgelegt:
<add name="ApplicationServices"
connectionString="Server=myServer;Database=myDB;User Id=myUserID;Password=myPWD;"
providerName="System.Data.SqlClient" />
<add name="ApplicationServices"
connectionString="Server=myServer;Database=myDB;User Id=myUserID;Password=myPWD;"
providerName="System.Data.SqlClient" />
Warum es versucht nicht halten eine SQL Server EXPRESS Datenbank zu erstellen?
Der Name der Verbindungszeichenfolge muss dem Datenbankkontext entsprechen. Siehe http://stackoverflow.com/questions/5346926/code-first-specify-database-name – AaronLS
Entschuldigung, ich habe Ihr Problem möglicherweise falsch verstanden. Ich nahm an, dass du zuerst den EF-Code benutzt hast. – AaronLS
hast du das gelöst? Ich habe genau denselben Fehler. – Chatumbabub