2011-06-29 139 views
1

我在ASP.Net中創建了一個Web站點(不是Mvc,我忘了其他名稱)。ASP.NET登錄問題

完成網頁後。我點擊「生成」按鈕,嘗試註冊到一個正常的asp.net登記表格在網站上,我歌廳此錯誤:

An error occurred during the execution of the SQL file 'InstallCommon.sql'. The SQL error number is 5123 and the SqlException message is: CREATE FILE encountered operating system error 5(failed to retrieve text for this error. Reason: 15105) while attempting to open or create the physical file 'C:\INETPUB\WWWROOT\ALON\APP_DATA\ASPNETDB_TMP.MDF'. CREATE DATABASE failed. Some file names listed could not be created. Check related errors. Creating the ASPNETDB_0e95afe2ec5d4f3d93bb9e61527a5bcf database...

我使用Windows 7的視覺IIS7.5 Stuido 2010 Pro。

任何人都有如何解決這個問題的想法?

+1

聽起來像ASPNETDB_TMP.MDF被其他進程鎖定。你確定你沒有打開另一個解決方案嗎?你重新啓動VS,你的電腦? –

+0

我已經關閉所有視覺stuiods形式是opend,重新設置是7.5,仍然不工作,我沒有重置計算機..但我沒有thnik它有任何影響。 –

+0

它可能是一個安全問題。也許您的Web應用程序運行的帳戶沒有權限在SQL Server Express實例中創建數據庫。 –

回答

0

我想你正在使用標準的登錄表單以及Membership API。將SQL Server Express Edition與ASP.NET結合使用時,SqlMembershipProvider可以創建一個數據存儲,供您的成員資格提供程序自動使用。但是,使用任何其他版本的SQL Server時,必須手動創建此數據存儲。

您可以使用aspnet_regsql.exe工具,然後配置您的連接字符串。

希望這tutorial將有所幫助。

0

您的應用程序池運行的用戶應該有權在您使用的SQL實例中創建數據庫。嘗試將應用程序池中的用戶臨時更改爲管理員(假設您在開發計算機上而不是生產中)。