引用Oracle.DataAccess.dll,,在oracle 安装目录下的D:oracleproduct10.2.0db_1ODP.NETin1.xOracle.DataAccess.dll
public static void GetFirstData(string connectionString, string commandString,out string xml,out string last_update_dtime, params OracleParameter[] parameters) { using (Oracle.DataAccess.Client.OracleConnection myConnection = new Oracle.DataAccess.Client.OracleConnection(connectionString)) { try { xml = ""; last_update_dtime = ""; Oracle.DataAccess.Client.OracleCommand myORACCommand = myConnection.CreateCommand(); myORACCommand.CommandText = commandString; myConnection.Open(); Oracle.DataAccess.Client.OracleDataReader myDataReader = myORACCommand.ExecuteReader(); myDataReader.Read(); xml = myDataReader.GetValue(1).ToString(); last_update_dtime = myDataReader.GetValue(0).ToString(); myDataReader.Close(); myConnection.Close(); } catch (Exception ex) { xml = ""; last_update_dtime = ""; } }; }