Currently I'm using the following method to get data from Oracle database and return it to DataTable
:
private static DataTable OraSelect(string cmdString)
{
string conString = ConfigurationManager.AppSettings["dbconnection"];
OracleConnection oraCon = new OracleConnection(conString);
OracleCommand oraCmd = new OracleCommand(cmdString, oraCon);
OracleDataAdapter oraDA = new OracleDataAdapter(oraCmd.CommandText, oraCon);
DataTable dt = new DataTable();
oraCon.Open();
oraDA.Fill(dt);
oraCon.Close();
return dt;
}
Visual Studio displays the following warning: "OracleConnection has been deprecated."
I think that's not the best way to do this. Could you give me some examples about how to get data from an Oracle database with a better method?