2013-07-16 30 views
0

Azure非常新。我創建了承載SQL Server 2008的Azure虛擬機。在Azure虛擬相機上獲取與網絡相關的錯誤SQL Server 2008

我的應用程序使用ASP.NET MVC 4並託管在Amazon Web Service上。該應用程序運行良好,我可以使用Management Studio連接到數據庫。 但是,我現在有時會出現此錯誤。

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) 

我不知道如何解決這個問題。 我是否需要實現作爲SQL Azure的數據庫重試連接,我現在使用傳統的連接字符串和NHibernate,連接SQL Server的域名(abc.cloudapp.net) 或者如果我們使用SQL Server還有其他問題需要考慮2008在Azure虛擬機上。

作爲@ SqlACID的評論,這是我當前的連接字符串。 Server = domain.cloudapp.net; Database = db; User ID = uid; Password = pwd;我出於安全原因將實際價值更改爲域,db和pwd。

但是,這在昨天的某個時候發生了三次。

非常感謝。

+1

你可以發表你的連接字符串? – SqlACID

+0

@SqlACID我加了連接字符串,謝謝 – embarus

回答

0

可能存在連接到SQL Server的問題。

它可以

  1. 的DB處於脫機狀態。
  2. 使用的連接字符串無效(用戶名或密碼不匹配)。
  3. 實例數據庫名稱不正確。 (拼寫錯誤)

請檢查您的web.config文件。

A very Good link of Possible errors with answers.

More error list here

MSDN Similar Question

Stack similar Question

+0

非常感謝你@Luv的快速回復。 我認爲用戶名和密碼是正確的,因爲我可以連接到數據庫,它現在正在工作。然而有時我得到了錯誤。 – embarus

相關問題