2009-06-03 159 views
0

我是新來的asp.net,並且正在嘗試在生產服務器上測試我的第一個站點。在服務器上登錄失敗 - asp.net

我有一個登錄控件「login.aspx」,成功登錄後將用戶重定向到該網站的管理區域。 當我在Windows XP計算機上使用VS2008測試站點時,所有工作都很好,我可以登錄和管理站點。我正在使用表單身份驗證來處理登錄。

當我將該網站上傳到生產服務器時,這是一個不同的故事。我可以訪問login.aspx頁面。當我輸入我的登錄信息並單擊「登錄」時,處理該頁面需要很長時間,頁面甚至失敗。

這是我得到的錯誤:

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: 


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. 
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 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. 

任何人可以幫我這個問題。

回答

3

你有沒有看過的錯誤信息?它確切地說錯了什麼,以及如何修復它:-)

它明確指出「連接字符串指定使用應用程序App_Data目錄中的數據庫位置的本地Sql Server Express實例。提供程序試圖自動創建應用程序服務數據庫,因爲提供程序確定數據庫不存在。「

Ergo,web.config文件中引用的數據庫未上傳到生產站點。

將其上傳至App_Data,然後返回給我們。

-Oisin

p.s.連接字符串在Web.config中。

+0

嗨xOn, 我讀了錯誤。我的連接字符串如下: 我的會員供應商如下: <添加minRequiredNonalphanumericCharacters = 「0」 的connectionStringName = 「ASPNETDBConnectionString」 的applicationName = 「PHONESITE」 NAME = 「MYPROVIDER」 TYPE = 「System.Web.Security.SqlMembershipProvider」/> Jason 2009-06-03 02:03:13

相關問題