0

我一直在嘗試處理包含用戶和角色管理的ASP.NET項目。我試圖使用的第一件事是ASP.NET配置,它將爲我打開一個網站,在那裏我可以添加用戶和角色。我得到這個網站。接下來是我點擊「安全」選項卡。這應該讓我做進一步的配置。但是,當我點擊安全選項卡時,屏幕上會顯示"Unable to connect to SQL SERVER DATABASE",下面有一個選項"choose data source"。當我點擊那個按鈕時,它會進入「提供者」選項卡。在這裏,我可以看到一個名爲「AspNetSqlProvider」的選項。當我測試此提供我得到這個消息:ASP.NET用戶管理問題

Provider Management Could not establish a connection to the database. If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database, and then return to this tool to set the provider.

,因爲我一直在用我的應用程序SQL Server和它一直工作正常,我不明白的問題。

請注意,我沒有在我的電腦上安裝sql server express版本。相反,我已經安裝了SQL Server 2008

另外的完整版本,當我嘗試建立從SQL Server Management Studio中使用Windows身份驗證的連接,我得到一個消息說:

Cannot connect to SUDHIR-PC 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (.Net SqlClient Data Provider)

但是,我在我的asp.net項目中使用了相同的連接來建立數據庫連接並使用一直工作正常的數據庫。

請指導我解決這個問題。

回答

0

命名管道連接在大多數SQL2008版本中默認處於禁用狀態,當您說「完成」時我不確定您的意思是哪個版本。企業?標準?開發者?這是一個link默認值。

您將需要啓用命名管道通過SSMS

連接下面是一個全面的link覆蓋使連接和可能的Windows防火牆的注意事項。

+0

它的開發者版本。奇怪的是,我無法使用SQL管理工作室中的Windows身份驗證連接到服務器,因爲我建立了連接,並且還通過我的asp.net應用程序使用了Visual Studio中的數據庫。 –