簡體   English   中英

無法執行從客戶端(aspx頁)到wcf服務的存儲過程(使用DAAB)

[英]could not execute a stored procedure(using DAAB) from a client(aspx page) to a wcf service

我試圖通過存儲在ASP.NET空網站中的wcf服務中的存儲過程(使用DAAB)將數據從asp.net客戶端網站存儲到sql數據庫中。當我嘗試將數據存儲到數據庫時,我得到以下信息錯誤:

 **

 - The server was unable to process the request due to an internal
   error.  For more information about the error, either turn on
   IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute
   or from the <serviceDebug> configuration behavior) on the server in
   order to send the exception information back to the client, or turn
   on tracing as per the Microsoft .NET Framework SDK documentation and
   inspect the server trace logs.

** 

當我嘗試調試時,出現以下異常:嘗試獲取數據庫類型的實例時發生激活錯誤,代碼中的鍵“”-

 Database db = EnterpriseLibraryContainer.Current.GetInstance<Database>("MyInstance");

我的app.config在哪里

<?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true"/>
  </configSections>
  <dataConfiguration defaultDatabase="MyInstance"/>
  <connectionStrings>
    <add name="MyInstance" connectionString="Data Source=BLRKDAS307581\KD;Integrated Security=True;User ID=SAPIENT\kdas3;Password=ilove0LINUX" providerName="System.Data.SqlClient" />
  </connectionStrings>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>
</configuration>

有人可以幫我嗎? 提前致謝...

默認情況下,EnterpriseLibraryContainer將從web.config中讀取它在ASP.NET下運行的WCF服務的配置。 除非您正在執行一些高級配置選項(例如FileConfigurationSource,重定向的部分,手動加載配置文件等),否則配置信息應該放在web.config中。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM