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

  • Home
  • SEARCH
  • 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 6734365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:52:48+00:00 2026-05-26T10:52:48+00:00

I am using: Visual Studio 2010 .Net Framework Data Provider for Oracle Oracle Developer

  • 0

I am using:

  • Visual Studio 2010
  • .Net Framework Data Provider for Oracle
  • Oracle Developer Tools for Visual Studio (from Oracle’s website)

I tried installing ‘Oracle Developer Tools for Visual Studio’ and created tnsnames.ora and sqlnet.ora files in my C:\app\ [my username]\product\11.2.0\client_1\Network\Admin directory.

They look like this:

# tnsnames.ora

ORATEST =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = dbs-oratest)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = [ORATEST])
    )
  )

and

# sqlnet.ora

SQLNET.AUTHENTICATION_SERVICES= (ALL)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

When I try using the .Net Framework Data Provider for Oracle driver to set up a new connection (or any other driver for that matter: OLE, ODBC, etc) it gives the error:

ORA-12154: TSN:could not resolve the connect identifier specified

Using the OLE driver on a machine without the Oracle client installed DOES work though:

OleDbConnection conn = new OleDbConnection(
    "Provider=MSDAORA;Data Source=ORATEST;" + 
    "Persist Security Info=True;Password=readonly;User ID=readonlyuser");

What am I doing wrong? Are there any simple instructions online about how to install a basic Oracle driver?

Thank you in advance!

  • 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-05-26T10:52:49+00:00Added an answer on May 26, 2026 at 10:52 am

    The best solution I found was to use the Oracle Data Access Client library, and include the entire TNS names entry in the connection string. This allows the project to be easily published to a web server, ClickOnce, etc.

    Here are the steps necessary to set up the Oracle driver working in your project:

    1) Get DLLs from ‘Oracle Data Provider for .NET’ package

    Download installer file from this location: http://www.oracle.com/technetwork/topics/dotnet/index-085163.html

    I went ahead and installed the full 200 MB ODAC with Oracle Developer Tools for Visual Studio, but you only really need four DLLs from this download. (You may be able to extract them directly from the installer package, instead of going through the entire install process, or perhaps one of the smaller download includes all of them.)

    2) Reference DLLs in your project

    Search the installation directory of the Oracle Data Access Client and drag the following four DLLs into the root of your project:

    • Oracle.DataAccess.dll
    • oci.dll
    • oraciicus11.dll
    • OraOps11w.dll

    Set the Copy to Output Directory property all of the files except Oracle.DataAccess.dll to Copy always.

    Under Project –> Add Reference…, click on the Browse tab and select the Oracle.DataAccess.dll file.

    3) Use the driver with full connection string (optional)

    So as not to have to worry about TNS names files being set up on the machines the application was deployed to, I put the entire definition in the file as shown by connectionstrings.com. It makes the connection string a little bulky, but removed a lot of the TNS Names file headaches I was experiencing before:

    Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=servername)(PORT=‌​1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=servicename)));User Id=username;Password=********;
    

    Here’s the full class I used to test the driver:

    using System;
    using System.Data;
    using Oracle.DataAccess.Client;
    
    static class Program
    {
        [STAThread]
        static void Main()
        {
            TestOracle();
        }
    
        private static void TestOracle()
        {
            string connString = 
                "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)" + 
                "(HOST=servername)(PORT=‌​1521)))" +
                "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=servicename)));"+ 
                "User Id=username;Password=********;";
            using (OracleConnection conn = new OracleConnection(connString))
            {
                string sqlSelect = "SELECT * FROM TEST_TABLE";
                using (OracleDataAdapter da = new OracleDataAdapter(sqlSelect, conn))
                {
                    var table = new DataTable();
                    da.Fill(table);
    
                    if (table.Rows.Count > 1) 
                        Console.WriteLine("Successfully read oracle.");
                }
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Visual Studio 2010 RTM with .NET/Entity Framework 4 RTM with a model
Using Visual Studio 2010 .Net Framework 4 C# Linq to Entities Issue I would
I'm using Visual studio 2010 and .NET Framework 4.0. Code: public void LoginTo(string username,
I'm using the Visual Studio 2010 RC for .NET 4.0 and I'm trying to
Background Information: Visual Studio 2010 (.NET Framework 4.0) Informix Server 7.31 Informix ClientSDK 3.50
Consider a Visual Studio 2010 project whose requirement is to model the data using
Windows 7, Visual Studio 2010, tagert framework = .NET 4 Client Profile I'm creating
My scenario I'm using Visual Studio 2010 with Entity Framework 4.1 I have a
Can I develop asp.net 3.5/2.0 projects using Visual Studio 2010? Or I will be
I'm trying to build System.Data.SQLite in Visual Studio using the source code downloaded from

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.