Click here to Skip to main content
13,141,157 members (62,977 online)
Rate this:
Please Sign up or sign in to vote.
Hi all ,
we have some oracle applications running on an oracle application server and we have other web application that running on other servers and SQL server too, so mainly what i want to ask about :- is there any way to write a web application that can connect to oracle database on a 64bit machine using VS 2010, that can migrate and retrieve data from Oracle Database to SQL server ??

Thank you so much.
Posted 25-Sep-12 0:21am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Add ref to System.Data.OracleClient and define your connection.

using System.Data.OracleClient;

private static string CONNECTION_STRING =
  "User Id=myUserID;Password=myPassword;Data Source=(DESCRIPTION=" +

using (OracleConnection connection = new OracleConnection()) 
    connection.ConnectionString = CONNECTION_STRING; 
    Console.WriteLine("State: {0}", connection.State); 
    Console.WriteLine("ConnectionString: {0}", 
    OracleCommand command = connection.CreateCommand(); 
    string sql = "SELECT * FROM MYTABLE"; 
    command.CommandText = sql; 
    OracleDataReader reader = command.ExecuteReader(); 
    while (reader.Read()) 
      string myField = (string)reader["MYFIELD"]; 
rushdi obeidat 26-Sep-12 2:50am
hi, thank you so much for the solution , but when i tried it out the following error appears : - System.Data.OracleClient requires Oracle client software version 8.1.7 or greater.
Kuthuparakkal 26-Sep-12 3:08am
Install Oracle Instant Client( will do) :
Once you install find the following dlls:

Copy the above 4 dlls into the same directory as your executable.
Rajesh Varatharajan 20-Jun-13 5:30am
i tried the above but the following error came:

error C2039: 'OracleClient' : is not a member of 'System::Data'
CHill60 20-Jun-13 9:29am
You must have a more recent version of VisualStudio than Kuthuparakkal - OracleClient has been deprecated. See this[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170915.1 | Last Updated 20 Jun 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100