1

次のように web.config を設定しました。

<add name="DefaultConnection" connectionString="Data Source='C:\Users\Marilou\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\v11.0\authentication.mdf';Initial Catalog=javacert;Persist Security Info=True;User ID=sa;Password=yyy" providerName="System.Data.SqlClient" />

しかし、私はメッセージを受け取っています:

   Message=The provider did not return a ProviderManifestToken string.
   Source=EntityFramework
   StackTrace:
        at System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection)
        at System.Data.Entity.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices, DbConnection connection)
   InnerException: System.Data.SqlClient.SqlException
        HResult=-2146232060
        Message=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)
        Source=.Net SqlClient Data Provider
        ErrorCode=-2146232060
4

1 に答える 1

0

LocalDBを使用しているようです。この MSDN の記事 ( http://blogs.msdn.com/b/sqlexpress/archive/2011/07/12/introducing-localdb-a-better-sql-express.aspx ) から、接続文字列は次のようになります。

Data Source=(localdb)\v11.0;Integrated Security=true;AttachDbFileName=C:\MyData\Database1.mdf".
于 2013-10-03T17:10:41.467 に答える