0

I am trying to deploy my application on Windows server 2007 32 Bit. My application gave me this Exception

Error on opening DbConnection. bei Devart.Data.Linq.LinqCommandExecutionException.CanThrowLinqCommandExecutionException (String message, Exception e) bei Devart.Data.Linq.Provider.k.a.g() bei Devart.Data.Linq.Provider.k.a.b(IConnectionUser A_0) bei Devart.Data.Linq.Provider.k.b(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() bei System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) bei System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)

while executing this line in my program

var list = clientCustomers.ToList();

Code

    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);
        }
    }
gitsitgo
  • 6,589
  • 3
  • 33
  • 45

1 Answers1

0

When deploying applications written with the help of LinqConnect you should register run-time assemblies Devart.Data.Oracle.dll, Devart.Data.dll, Devart.Data.Oracle.Linq.dll and Devart.Data.Linq.dll at Global Assembly Cache (GAC) or place them in the folder of your application. When deploying ASP.NET applications it is also necessary to have Devart.Data.Oracle.Web.dll and App_Licenses.dll assemblies available.

If all required assemblies are available for your project, please perform the following steps:

  1. Make sure that Oracle Client Software is installed on your computer;
  2. Specify the name of Oracle Home explicitly in the Home connection string parameter.
  3. Place the content of the ORACLE_HOME variable on the first position in the PATH variable of your operating system;
  4. Make sure that capacity (x86 or x64) of your application and the capacity of your Oracle Client are the same.

If after these steps the issue still persists, please contact us with more details for this issue, e.g.:

  • the full stack trace of the exception;
  • the connection string;
  • the version of the Oracle Client;
  • the version of the Oracle server;
  • the definitions of the database tables and corresponding entity classes, etc.
Devart
  • 119,203
  • 23
  • 166
  • 186