Trying to connect to an Oracle database through Visual Studio 2010

1142605 pts.
Tags:
Oracle Database
Visual Studio 2010
I'm trying to connect to an Oracle database through Visual Studio 2010. The only thing is that I don't actually want to download Oracle. I've referenced System.Data.OracleClient but it's not doing it for me. I do have an Oracle SQL Developer IDE to run SQL queries against an Oracle DB. Here' the code:
 private static string GetConnectionString()
    {
        String connString = "host= serverName;database=myDatabase;uid=userName;pwd=passWord";
        return connString;
    }

 private static void ConnectingToOracle()
    {
        string connectionString = GetConnectionString();
        using (OracleConnection connection = new OracleConnection())
        {
            connection.ConnectionString = connectionString;
            connection.Open();
            Console.WriteLine("State: {0}", connection.State);
            Console.WriteLine("ConnectionString: {0}",
                              connection.ConnectionString);

            OracleCommand command = connection.CreateCommand();
            string sql = "SELECT * FROM myTableName";
            command.CommandText = sql;

            OracleDataReader reader = command.ExecuteReader();
            while (reader.Read())
            {
                string myField = (string)reader["MYFIELD"];
                Console.WriteLine(myField);
            }
        }
    }
Like I said, I haven't downloaded anything from Oracle. What should I do here?
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

Try using oracle instant client. It’s a small footprint, unlike the other installs.

—-

You need to download the Oracle Data Provider for .NET

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: