odbc instructions to connect to oracle odbc instructions to connect to oracle oracle oracle

odbc instructions to connect to oracle


Don't use ODBC. ODP.NET is a driver provided by Oracle which is based on the same model as SQL Server: simply download the assembly, reference it in your project and use it:

    using (var conn = new OracleConnection("Some connection string"))    using (var cmd = conn.CreateCommand())    {       conn.Open();       cmd.CommandText = "SELECT id FROM foo";       using (var reader = cmd.ExecuteReader())       {          while (reader.Read())          {             int id = reader.GetInt32(0);          }       }    }       


According to a similar question, Manually connecting to database in Asp.net MVC, there's no magic involved. Just connect to the db as you normally would.

There's a VB example @ http://www.aspdev.org/articles/asp.net-mysql-connect/ It's for MySql but should be simple enough to switch to your Oracle connection string.


There is at least one ado.net provider for Oracle that doesn't require an Oracle client on the machine. See http://www.devart.com/dotconnect/oracle/. Devart calls this feature 'direct mode'. This Oracle specific provider will also probably perform much better than an odbc provider.

But there is something I don't understand? You have build an asp.net mvc application so you only have to install on a server. So what is the problem?