我想在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);
}
}
dbconnection是否已更改?產生錯誤的代碼在哪裏? – christiandev
沒有dbconnection沒有改變..我沒有這個問題本地只是當我部署在臨時服務器上 –