Click here to Skip to main content
11,647,170 members (70,577 online)
Rate this: bad
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 at 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 at 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 at 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 at 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
0 500
1 F-ES Sitecore 360
2 DamithSL 335
3 OriginalGriff 322
4 CPallini 290
0 OriginalGriff 1,277
1 994
2 DamithSL 946
3 Sergey Alexandrovich Kryukov 853
4 CPallini 760

Advertise | Privacy | Mobile
Web02 | 2.8.150804.2 | Last Updated 20 Jun 2013
Copyright © CodeProject, 1999-2015
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