通过Web部件引起的SQL Server错误 [英] Sql Server Error Caused by Web Part

查看:123
本文介绍了通过Web部件引起的SQL Server错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的WebParts创建一个仪表板页面。要做到这一点我动态加载的webpart。

I am using webparts to create a dashboard page. To do that i am dynamically loading the webparts.

strZoneNumber = "zone" + intCnt.ToString();
UserControl UC = (UserControl)LoadControl(row["c_widget_path"].ToString());//Loads the usercontrol
UC.ID = row["c_widget_webid"].ToString();
UC.Attributes.Add("Title", row["c_widget_webid"].ToString());
//UC.Attributes.Add("title" , "Test");
GenericWebPart ucwebPart = wpmDashBoardManager.CreateWebPart(UC);//creates a webpart
wpmDashBoardManager.AddWebPart(ucwebPart, wpmDashBoardManager.Zones[strZoneNumber], ZoneIndex);//adds it to a zone
wpmDashBoardManager.Zones[strZoneNumber].Visible = true;

我WebPartManager的个性化模式被设定为真

My webpartmanager personalization mode is set to 'true'

虽然它给我下面的错误在服务器上运行这个页面:

While running this page on the server it is giving me the following error:

建立SQL Server的连接时发生网络相关的或特定于实例的错误。服务器未找到或无法访问。验证实例名称是否正确,以及SQL Server配置为允许远程连接。 (提供者:SQL网络接口,错误:26 - 错误定位服务器/实例指定)
  说明:执行当前Web请求的执行过程中发生未处理的异常。请查看有关错误的详细信息的堆栈跟踪以及它起源于code。

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.

SQLEx preSS数据库文件自动创建错误:
  连接字符串指定使用应用程序App_Data目录中的数据库位置本地SQL Server防爆preSS实例。
   提供者执行,因为供应商确定数据库不存在自动创建应用程序服务数据库。下面的配置要求是必要的,成功地检查应用程序服务数据库是否存在并自动创建应用程序服务数据库:

SQLExpress database file auto-creation error: The connection string specifies a local Sql Server Express instance using a database location within the applications 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:

如果应用程序App_Data目录不存在,则Web服务器帐户必须具有读取和写入权限对应用程序目录。这是必要的,因为Web服务器帐户将会自动创建App_Data目录,如果它不存在。

If the applications App_Data directory does not already exist, the web server account must have read and write access to the applications directory. This is necessary because the web server account will automatically create the App_Data directory if it does not already exist.

如果应用程序App_Data目录已经存在,web服务器帐户只需要读取和写入访问应用程序App_Data目录。这是必要的,因为Web服务器帐户将尝试验证Sql Server的防爆preSS数据库已在应用程序App_Data目录中存在。吊销读取来自Web服务器帐户对App_Data目录的访问将prevent正确地确定如果SQL Server防爆preSS数据库已经存在的供应商。当供应商试图创建一个已经存在的数据库的副本,就会出错。由于Web服务器创建新数据库时,凭据用于占写访问是必需的。

If the applications App_Data directory already exists, the web server account only requires read and write access to the applications App_Data directory. This is necessary because the web server account will attempt to verify that the Sql Server Express database already exists within the applications App_Data directory. Revoking read access on the App_Data directory from the web server account will prevent the provider from correctly determining if the Sql Server Express database already exists. This will cause an error when the provider attempts to create a duplicate of an already existing database. Write access is required because the web server accounts credentials are used when creating the new database.

Sql Server的防爆preSS必须安装在机器上。
为Web服务器帐户的进程标识必须具有本地用户配置文件。请参阅有关如何创建计算机以及域帐户本地用户配置文件的详细信息,请参见自述文档。**

Sql Server Express must be installed on the machine. The process identity for the web server account must have a local user profile. See the readme document for details on how to create a local user profile for both machine and domain accounts.**

任何想法,什么可能导致这和解决方案?帮助将不胜AP preciated:))

Any ideas as to what might be causing this and solutions? Help would be greatly appreciated :):)

推荐答案

ASP.NET的许多功能都依赖于内部的应用服务,如会员资格,角色,配置文件和个性化。例如,ASP.NET个性化服务使用个性化设置提供保存在网页上的个性化的用户设置。默认情况下Web部件尝试个性化保存到SQL防爆preSS数据库。

Many features of ASP.NET rely on intrinsic application services such as membership, roles, profiles, and personalization. For example, the ASP.NET personalization service uses a personalization provider to save personalized user settings on Web pages. By default Web Parts try to save personalizations into SQL Express database.

该解决方案是有帮助我。

This solution was helpfull for me.

在web.config文件的connectionStrings节删除LocalSqlServer连接,并用自己的preferences再次添加它:

In connectionStrings section of your web.config file remove LocalSqlServer connection and add it again with your own preferences:

<connectionStrings>
    <remove name="LocalSqlServer"/>
    <add name="LocalSqlServer" connectionString="yourConnectionString" providerName="System.Data.SqlClient"/>
</connectionStrings>

然后,如果你将有找不到存储过程'dbo.aspnet_CheckSchemaVersion的错误,你应该创建一个新的数据库供您使用的个性化。
所以,仅仅探索 C:\\ WINDOWS \\ Microsoft.NET \\框架\\ V2.0.50727 \\ aspnet_regsql.exe的并办理向导的步骤

希望这会有所帮助。

这篇关于通过Web部件引起的SQL Server错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆