2013-08-07 43 views
0

我想在Windows Server 2007 32位上部署我的應用程序。 我的申請給了我這個例外服務器「Devart.Data.Oracle.Linq.Provider」上的異常Devart.Data.Linq

打開DbConnection時出錯。貝Devart.Data.Linq.LinqCommandExecutionException.CanThrowLinqCommandExecutionException (字符串消息,例外五) 貝Devart.Data.Linq.Provider.kag() 貝Devart.Data.Linq.Provider.kab(IConnectionUser A_0) 貝Devart。 Data.Linq.Provider.kb(IConnectionUser A_0) bei Devart.Data.Linq.Provider.DataProvider.ExecuteQuery(CompiledQuery compiledQuery,Object [] parentArgs,Object [] userArgs,Object lastResult) bei Devart.Data.Linq.Provider .DataProvider.ExecuteAllQueries(CompiledQuery compiledQuery,Object [] userArguments) bei Devart.Data.Linq.Provider.DataProvider.CompiledQuery.Devart.Data.Linq.Provider.ICompiledQuery.Execute(IProvider provider,Object [] userArgs) bei Devart .Data.Linq.DataQuery`1.i() 貝System.Collections.Generic.List`1..ctor(IEnumerable`1集合) 貝System.Linq.Enumerable.ToList [TSource](IEnumerable`1源)

在執行在此行中我程序

var list = clientCustomers.ToList();

代碼

public Repository(String Connection, String EventPackageName, String EventScopeName) 
    { 
     this.connectionDict = this.getConnectionInfo(Connection); 

     //this.context = new DataContext(connection);//old way 
     this.context = new DataContext(Connection, new Devart.Data.Oracle.Linq.Provider.OracleDataProvider()); 

     this.eventContext = new EventPacDataContext(Connection); 
     this.eContext = new Context.EventPacDataContext(Connection, new Devart.Data.Oracle.Linq.Provider.OracleDataProvider()); 

     this.eventPackageName = EventPackageName; 
     this.eventScopeName = EventScopeName; 
     this.clientUserName = this.connectionDict["User Id"]; 
    } 

    /// <summary> 
    /// Collect all Customers from VIEW 
    /// </summary> 
    /// <returns>IQueryable<Customer></returns> 
    public IQueryable<Customer> GetCustomers() 
    { 
     try 
     { 

      var result = from p in this.context.YDEVQUALIBASICs 
         join extended in this.context.YDEVQUALIBASICEXTENDEDs on 
         p.ACCOUNTID equals extended.ACCOUNTID 
         select 
         new Customer 
         { 
          Base = new Customer 
          { 
           CustomerId = p.CUSTOMERID.ToString(), 
           CustomerNo = p.CUSTOMERNO.ToString(), 
           Geburtsdatum = p.DETGEBURTSDATUM.GetValueOrDefault(new DateTime(1900, 1, 1)), 
           Email = p.DETEMAIL, 
           BusinessArea = p.ACCBUSINESSAREA, 
           ContractType = p.ACCCONTRACTTYPE, 
           ContractTariff = p.ACCCONTRACTARIFF, 
           SubscribeChannel = p.DETANMELDEKANAL, 
           PaymentMethod = p.CUSCOLLECTIONIDENT, 

           CustomerAddress = new Address 
           { 
            City = p.CUSCITY, 
            Street = p.CUSSTREET, 
            ExtendedInfo = p.CUSEHNR, 
            StreetNumber = p.CUSHNR, 
            LCountry = p.CUSCOUNTRYL, 
            SCountry = p.CUSCOUNTRYS, 
            ZipCode = p.CUSZIPCODE 
           }, 

            AccountPerson = new Person 
            { 
             Salutation = p.ACCANREDE, 
             Title = p.ACCAKADEM, 
             Branche = p.ACCBRANCHE, 
             Lastname = p.ACCTOMERNAME1, 
             Firstname = p.ACCTOMERNAME2, 
             Name3 = p.ACCTOMERNAME3 
            } 
           }, 
           CustomerPerson = new Person 
           { 
            Salutation = p.CUSANREDE, 
            Title = p.CUSAKADEM, 
            Branche = p.CUSBRANCHE, 
            Lastname = p.CUSTOMERNAME1, 
            Firstname = p.CUSTOMERNAME2, 
            Name3 = p.CUSTOMERNAME3 
           }, 

          InternGeolocChecked = extended.DETINTERNGEOLOCCHECKED, 
          InternGeolocStatus = extended.DETINTERNGEOLOCSTATUS, 
         }; 

      return result; 

     } 
     catch (ReflectionTypeLoadException ex) 
     { 
      StringBuilder sb = new StringBuilder(); 
      foreach (Exception exSub in ex.LoaderExceptions) 
      { 
       sb.AppendLine(exSub.Message); 
       if (exSub is FileNotFoundException) 
       { 
        FileNotFoundException exFileNotFound = exSub as FileNotFoundException; 
        if (!string.IsNullOrEmpty(exFileNotFound.FusionLog)) 
        { 
         sb.AppendLine("Fusion Log:"); 
         sb.AppendLine(exFileNotFound.FusionLog); 
        } 
       } 
       sb.AppendLine(); 
      } 
      string errorMessage = sb.ToString(); 
      //Display or log the error based on your application. 
      logger.Fatal("Aha: " + errorMessage); 
      return null; 
     } 

     catch (Exception ex) 
     { 
      logger.Fatal("Customer failed: " + ex.Message + ex.StackTrace); 
      throw new DataAccessException("Customer failed", ex); 
     } 
    } 
+0

dbconnection是否已更改?產生錯誤的代碼在哪裏? – christiandev

+0

沒有dbconnection沒有改變..我沒有這個問題本地只是當我部署在臨時服務器上 –

回答

0

當部署編寫的應用程序在LinqConnect的幫助下,您應該在全局程序集緩存(GAC)中註冊運行時程序集Devart.Data.Oracle.dll,Devart.Data.dll,Devart.Data.Oracle.Linq.dll和Devart.Data.Linq.dll或將它們放在應用程序的文件夾中。 部署ASP.NET應用程序時,還需要有Devart.Data.Oracle.Web.dll和App_Licenses.dll程序集可用。

如果所有必需的組件可爲您的項目,請執行下列步驟:

  1. 確保Oracle客戶端軟件安裝在您的計算機上;
  2. 在Home連接字符串參數中明確指定Oracle Home的名稱。
  3. 將ORACLE_HOME變量的內容放在操作系統的PATH變量的第一個位置;
  4. 確保應用程序的容量(x86或x64)與Oracle客戶端的容量相同。

如果這些步驟的問題仍然存在,請contact us更多的細節針對此問題後,例如:

  • 異常的完整堆棧跟蹤;
  • 連接字符串;
  • Oracle客戶端的版本;
  • Oracle服務器的版本;
  • 數據庫表和相應實體類的定義等