Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8528229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:45:21+00:00 2026-06-11T08:45:21+00:00

I keep getting this error when trying to open a connection using entity framework.

  • 0

I keep getting this error when trying to open a connection using entity framework.
I can update the model from the database with no problems at all, but when I run the code in debug it gives this error.
(Running on a Windows 2008 VM)

The code fragment where the error appears looks like this:

public partial class SpatialDatabase : global::System.Data.Objects.ObjectContext
{
    try
    {
        using (EntityConnection conn = new EntityConnection(this.Connection.ConnectionString))
        {
            conn.Open(); // <== fails here

            EntityCommand cmd = conn.CreateCommand();
            ...

This is connection to an Oracle database.

This code is apparently running ok elsewhere so I have a feeling it is to do with the connection.
We are using an Oracle for .NET (ODAC) driver. I have no idea whether it’s 64 or 32 bit, but it works when updating the model but not when run in debug.

(I would show additional code if I knew what to show!)

Connection string from app.config:

<connectionStrings>
  <add name="SpatialDatabaseContext" connectionString="metadata=res://*/SpatialDatabase.csdl|res://*/SpatialDatabase.ssdl|res://*/SpatialDatabase.msl;provider=Oracle.DataAccess.Client;provider connection string=&quot;DATA SOURCE=ds_name_here;PASSWORD=password_here;PERSIST SECURITY INFO=True;USER ID=user_id_here&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>

[Edit]

System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

[/Edit]

[Edit2]

The above might be a red herring. I ran it again and didn;t see that error, but I did see this InnerException:

[Oracle.DataAccess.Client.OracleException] = {"ORA-12154: TNS:could not resolve the connect identifier specified"}

[/Edit2]

[Edit 3]

I tried to use the EFOracleProvider instead.
It builds ok, but when I go to generate the entity model I get this:

Microsoft (R) EdmGen version 3.5.0.0
Copyright (C) 2008 Microsoft Corporation. All rights reserved.

error 7001: The provider did not return a ProviderManifestToken string.
Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed.
An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

Generation Complete -- 1 errors, 0 warnings

I have both 32 bit and 64 bit versions of the Oracle client components installed.
How do I choose whether to run 32 bit or 64 bit??

[/Edit3]

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T08:45:22+00:00Added an answer on June 11, 2026 at 8:45 am

    For info, there was no fix.

    I ended up abandoning the VM I was having the problem on and building another (well someone else built it!)

    The problem is now gone.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I keep getting this error, I'm trying to get tweets from twitter via
I am trying to do a terminal update and I keep getting this error,
Trying to install pear package and keep getting this strange error. Can you shed
As the title says, keep getting this error when trying to compile. From Googling
So I keep getting this error when trying to compile C++ code using CodeBlocks.
I keep getting this No such file or directory error when trying to open
I keep getting this error while trying to modify some tables. Here's my code:
Keep getting this error after inserting a subdatasheet into a query and trying to
I'm trying to connect to SSIS through SSMS but i keep getting this error:
While trying to host the CLR, I keep getting this: error C2440: 'function' :

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.