
using System;
using System.Data;
using System.Data.OleDb;

class OracleTest
{
	static void Main()
	{


		//UID - User Id
		//PWD - Password
		//Server - Your Service name
		//Using Microsoft ODBC for Oracle DSN-Less
		//const string strConn = "Provider=MSDASQL;DRIVER={MicrosoftODBC for ORACLE};UID=scott;PWD=tiger;Server=fnqa";

		//Using Microsoft OLEDB Provider for Oracle
		const string strConn = "Provider=MSDAORA.1;DataSource=oracle_db;User ID=scott;Password=tiger";

		//Using DSN Connection
		//const string strConn ="DSN=oracle_dsn;UID=scott;PWD=tiger" ;
		const string strSQL = "Select * From EMP";

		try
		{
			DataSet ds = new DataSet("EmployeesSet");
			OleDbConnection conn = new OleDbConnection(strConn);
			OleDbDataAdapter adapter = new OleDbDataAdapter();
			adapter.SelectCommand = new OleDbCommand(strSQL, conn);
			adapter.Fill(ds);
			ds.WriteXml("empxml");
		}
		catch(Exception e)
		{
			Console.WriteLine("Exception Occured :{0}",e.Message);
		}
	}
}
