“/”应用程序中的服务器错误 WebParts开发时出现的错误

 

“/”应用程序中的服务器错误。

在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 (provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错)


解决方案:
到C:\Windows\Microsoft.NET\Framework\v2.0.50727目录打开aspnet_regsql.exe文件










然后打开C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG中的web文件(web.config),
在<configuration></configuration>中加上
 <connectionStrings>
    <remove name="LocalSqlServer" />
    <add name="LocalSqlServer" connectionString="Data Source=localhost;Initial Catalog=aspnetdb;Integrated Security=true"
        providerName="System.Data.SqlClient" />
  </connectionStrings>

posted @ 2009-10-09 22:10  akiing  阅读(333)  评论(0编辑  收藏  举报