1
我的應用程序在MVC 4中,使用Entity框架的Sql Anywhere 16 ODBC。我用Visual Studio 2010.需求是多租戶,所以我創建連接字符串動態我的Global.asax和一旦主數據庫已連接,我創建連接字符串基於用戶的數據庫在我的帳戶控制器。Sybase iAnywhere.Data.SQLAnywhere.SAException:DSN數據庫名稱不存在
當我通過visual studio運行時,應用程序運行良好。但是當我在IIS 8.5上發佈此應用程序並在瀏覽器上加載應用程序時,它顯示下面的錯誤。
<ErrorType>System.Data.EntityException: The underlying provider failed
on Open. ---> iAnywhere.Data.SQLAnywhere.SAException: DSN 'MainDB'
does not exist at iAnywhere.Data.SQLAnywhere.SAConnection.Open()
at
System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean
openCondition, DbConnection storeConnectionToOpen, DbConnection
originalConnection, String exceptionCode, String attemptedOperation,
Boolean& closeStoreConnectionOnFailure) --- End of inner
exception stack trace --- at
System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean
openCondition, DbConnection storeConnectionToOpen, DbConnection
originalConnection, String exceptionCode, String attemptedOperation,
Boolean& closeStoreConnectionOnFailure) at
System.Data.EntityClient.EntityConnection.Open() at
PDMSReporter.Controllers.AccountController.Login(LoginModel Login) in
E:\Projects\Triforce_PDM
Reporter\Latest_PDMSReporter\PDMSReporter\PDMSReporter\Controllers\AccountController.cs:line
56</ErrorType>
<ErrorDesc>The underlying provider failed on Open.</ErrorDesc>
我試了很多來解決這個問題。但沒有找到適當的解決方案。
請幫我解決這個問題或建議後我可以解決它。
哦! k謝謝你的幫助。您能否詳細說明如何製作系統DSN(或任何步驟或博客)。我很抱歉,但我是Sql Anywhere中的新成員,所以我沒有太多想法。 – CrazyDev
你好,我能夠添加系統DSN和它的工作很好,謝謝你的幫助。 – CrazyDev