2011-11-09 11 views
1

Webパーツを使用してダッシュボードページを作成しています。これを行うには、私は動的にwebpartをロードしています。Webパーツで発生したSQL Serverエラー

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パーソナライズモードが「真」

に設定されています:アプリケーションApp_Dataにディレクトリがない場合は

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.

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:

をWebサーバーアカウントには、アプリケーションディレクトリへの読み書きアクセス権が必要です。 Webサーバーアカウントが存在しない場合、App_Dataディレクトリが自動的に作成されるため、これが必要です。

アプリケーションApp_Dataディレクトリが既に存在する場合、WebサーバーアカウントにはアプリケーションApp_Dataディレクトリへの読み書きアクセスのみが必要です。これは、WebサーバーアカウントがSql Server ExpressデータベースがアプリケーションApp_Dataディレクトリ内に既に存在することを確認しようとするため、必要です。 WebサーバーアカウントからApp_Dataディレクトリの読み取りアクセスを取り消すことで、Sql Server Expressデータベースが既に存在するかどうかをプロバイダが正しく判断できなくなります。これにより、プロバイダが既存のデータベースの複製を作成しようとするとエラーが発生します。新しいデータベースの作成時にWebサーバーアカウントの資格情報が使用されるため、書き込みアクセスが必要です。

マシンにSql Server Expressがインストールされている必要があります。 WebサーバーアカウントのプロセスIDには、ローカルユーザープロファイルが必要です。マシンアカウントとドメインアカウントの両方でローカルユーザープロファイルを作成する方法の詳細については、Readmeドキュメントを参照してください。**

これとソリューションの原因は何ですか?ヘルプは大きく評価されます:) :)

答えて

3

ASP.NETの多くの機能は、メンバーシップ、ロール、プロファイル、パーソナライゼーションなどの組み込みアプリケーションサービスに依存しています。たとえば、ASP.NETパーソナライゼーションサービスは、パーソナライゼーションプロバイダを使用して、パーソナライズされたユーザー設定をWebページに保存します。既定では、WebパーツはパーソナライゼーションをSQL Expressデータベースに保存しようとします。

この解決策は私にとって有益でした。その後

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

あなたは「ストアドプロシージャが見つかりませんでした 『持っているかどうdbo.aspnet_CheckSchemaVersion』エラーあなたは:あなたのweb.configファイルのconnectionStringsセクションで

LocalSqlServer接続を削除し、あなた自身の好みに再度追加パーソナライゼーションに使用するための新しいデータベースを作成する必要があります。 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exeを探索し、ウィザードの手順を実行してください。

希望すると助かります。

関連する問題