webpartmanager SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错
2008-11-17 00:58
429 查看
The Issue:
The webpartmanager is looking for SQL Express 2005 which, by default, is the personalization provider. We can work around this but if you are really eager to see your page displayed you can set the Personalization-Enabled="false" in the webpartmanager. This will render your page but it will also defeat any purpose of using webparts. For the real solution read on.
The Solution: (3 simple steps)
1) Open your visual studio command prompt located in "Start Menu/Programs/Microsoft Visual Studio 2005/Visual Studio Tools/Visual Stuido 2005 Command Prompt" and type in aspnet_regsql.exe. This will launch a wizard so that you can either create a DB or add tables to an existing database for storing personalization infromation. Click Next, Next, then enter in your DBServer Name. Lets leave the DB as "default" for now, click next, next, finish. By leaving the db as default the tool will create a database named aspnetdb
2) Now we have a database so we will need a connection string to access it from our Personalization Provider in Step 3. The connection string will go into your web.config and it will be similar to the one show below:
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="DBConn" connectionString="Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=aspnetdb;Data Source=DBServer" providerName="System.Data.SqlClient" />
</connectionStrings> Note: The "remove" tag is used to inform Visual Studio that we will not be using SQL Express
3) The final step is to add our own personalization provider in the <system.web> section of the webConfig. The personalization provider will point to the store we created by using the connection string we provide (Dbconn).<webParts>
<personalization defaultProvider="AspNetSqlPersonalizationProvider">
<providers>
<remove name="AspNetSqlPersonalizationProvider" />
<add name="AspNetSqlPersonalizationProvider"
type="System.Web.UI.WebControls.WebParts.SqlPersonalizationProvider"
connectionStringName="DBConn"
applicationName="/" />
</providers>
</personalization>
</webParts>
The webpartmanager is looking for SQL Express 2005 which, by default, is the personalization provider. We can work around this but if you are really eager to see your page displayed you can set the Personalization-Enabled="false" in the webpartmanager. This will render your page but it will also defeat any purpose of using webparts. For the real solution read on.
The Solution: (3 simple steps)
1) Open your visual studio command prompt located in "Start Menu/Programs/Microsoft Visual Studio 2005/Visual Studio Tools/Visual Stuido 2005 Command Prompt" and type in aspnet_regsql.exe. This will launch a wizard so that you can either create a DB or add tables to an existing database for storing personalization infromation. Click Next, Next, then enter in your DBServer Name. Lets leave the DB as "default" for now, click next, next, finish. By leaving the db as default the tool will create a database named aspnetdb
2) Now we have a database so we will need a connection string to access it from our Personalization Provider in Step 3. The connection string will go into your web.config and it will be similar to the one show below:
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="DBConn" connectionString="Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=aspnetdb;Data Source=DBServer" providerName="System.Data.SqlClient" />
</connectionStrings> Note: The "remove" tag is used to inform Visual Studio that we will not be using SQL Express
3) The final step is to add our own personalization provider in the <system.web> section of the webConfig. The personalization provider will point to the store we created by using the connection string we provide (Dbconn).<webParts>
<personalization defaultProvider="AspNetSqlPersonalizationProvider">
<providers>
<remove name="AspNetSqlPersonalizationProvider" />
<add name="AspNetSqlPersonalizationProvider"
type="System.Web.UI.WebControls.WebParts.SqlPersonalizationProvider"
connectionStringName="DBConn"
applicationName="/" />
</providers>
</personalization>
</webParts>
相关文章推荐
- 关于连接SQL 2005 出错: provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错 的解决方法
- 7、provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错
- SQL Server provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错
- 不同于其他的--provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错
- VS2005中连接数据库“provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错”的一种情况
- provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错
- provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错
- (provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错)
- SQL 2005 (provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错)
- provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错
- 在建立与服务器的连接时出错。在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连接可能会导致此失败。 (provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错)
- SQL2008 SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错解决方法
- 错误:在建立与服务器的连接时出错。在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连接可能会导致此失败。 (provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错) 解
- provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错
- 链接远程数据库时,提示“”provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错“解决方案!
- (转)在建立与服务器的连接时出错。在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连接可能会导致此失败。 (provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错)
- 在建立与服务器的连接时出错。在连接到 SQL Server 2005 时,在默认的设置下 SQL Server 不允许进行远程连接可能会导致此失败。 (provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错)
- SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错
- 解决SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错
- (provider: SQL 网络接口, error: 26 - 定位指定的服务器/实例时出错) 问题解决啦 O(∩_∩)O哈哈~