数据库连接错误: The provider did not return a ProviderManifestToken string.

  • Post author:
  • Post category:其他


这两天在学习Asp.mvc, 学习到了Model这一章节了,使用EF进行数据库连接操作,仿照例子,修改了一下字符串,然后修改在Web.config文件中,大体如下:

  <connectionStrings>
    <add name="ApplicationServices"
         connectionString="data source=.;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
         providerName="System.Data.SqlClient" />
    <add name="MovieDbContext"
     connectionString="Data Source =.\tt; Initial Catalog =movies; Integrated Security =SSPI;"
     providerName="System.Data.SqlClient" />
  </connectionStrings>

最开始的时候一看还有“ApplicationServices”, 心想我没有用到这个字符串,估计是作者把后面几张的内容给提前贴出来了,所以就删除了,只剩下了”MovieDbContext”这个连接字符串,结果一运行报了如下的错误:

The provider did not return a ProviderManifestToken string

想也没有想,网上搜了一下,看到StackOverFlow上有人再问,仔细看了一下没有什么明确的答案。

回过来看Inner Exception :’”{“A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found