blackdog wrote:
I have Oracle client in my system, like to use csharp to communicate
with Oracle server to
retrieve data.
I am very new in csharp, would anyone please give me an example codes
or web pointer.
thanks a lot.
using System.Data;
using System.Data.OracleClient;
class Program
{
pulic static void Main()
{
using (OracleConnection con = new OracleConnection("your connection
string here"))
{
OracleCommand cmd = con.CreateCommand();
cmd.CommandText = "select something from some database";
using (OracleDataReader rdr = cmd.ExecuteReader())
{
if (rdr.Read())
// ... read some data
}
}
}
}
http://msdn2.microsoft.com/en-us/lib...cleclient.aspx
You have to use .NET 1.1 or 2.0 to use OracleClient, otherwise you can use
System.Data.OleDb if you have to use .NET 1.0. You have to install the
Oracle client tools on the machine that will access the oracle server.
-cd