Właśnie wdrożyłem nową aplikację w ASP.Net MVC 4. Używam SQL Server 2008 R2 (NOT SQL Express).Błąd automatycznego tworzenia pliku bazy danych SQL Server Express w MVC 4 - Ale NIE chcę używać SQL Server Express
To działało dobrze przez pierwsze 10 minut, potem zrobiłem małą zmianę kodu i ponownie go wdrożyłem.
Teraz, gdy próbuję uzyskać dostęp do strony, która korzysta SimpleMembership, otrzymuję ten błąd:
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:
Ale robię nie używać SQL Server Express. W moim web.config
mam ustawić wszystkie ciągi połączeń w następujący sposób:
<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" />
Dlaczego próbować stworzyć EXPRESS bazy danych SQL Server?
Nazwa ciągu połączenia musi być taka sama jak kontekst bazy danych. Zobacz http://stackoverflow.com/questions/5346926/code-first-specify-database-name – AaronLS
Niestety, mogłem źle zrozumieć twój problem. Zakładałem, że najpierw używasz kodu EF. – AaronLS
rozwiązałeś to? Mam dokładnie ten sam błąd ... – Chatumbabub