1, http://www.oracle.com/technetwork/topics/winsoft-085727.html download the corresponding version of the Instanctclinet Zip package 34M decompression after 92M To select a non-32-bit operating system, find http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
2. Unzip the 9 files in the package into the System32 directory
3. Add System.Data.OracleClient Reference
4, using System.Data.OracleClient 5, string connectionString = "Data source= (DESCRIPTION = (Address_list = (ADDRESS = (P Rotocol = TCP) (HOST = 202.149.225.122) (PORT = 1521))) (Connect_data = (service_name = pub))); User id= Lahom; Password = JJ; Unicode=true; "; Unicode=true is the key to ensure that Chinese characters do not appear garbled!!
OracleConnection cnn = new OracleConnection (connectionString);
Cnn. Open ();
OracleCommand cmd = cnn. CreateCommand ();
Cmd.commandtext = ("SELECT * from AD");
OracleDataAdapter Myda = new OracleDataAdapter (cmd);
DataSet myds = new DataSet ();
Myda. Fill (myds);
MessageBox.Show (myds. Tables[0]. Rows[0]. ITEMARRAY[2]. ToString ());
2011-03-17 Free Oracle client-side remote Oracle method