Connection to Oracle in .Net Framework 1.0
Hi........
I've .Net Framework 1.0 and I want to connect Oracle 8i.
Can I do this in .Net Framework 1.0 ?
( System.Data.Odbc ) namespace does not exist in this version.
plz tell me how can I do it.......it would be more helpful if u post some code here.
Thanks,
Manoj
Re: Connection to Oracle in .Net Framework 1.0
huh...
I resolved it and I'm posting my code here for reference.......
//Connection with Oracle.
OleDbConnection Conn = new OleDbConnection() ;
OleDbDataAdapter DA ;
DataTable DT ;
Conn.ConnectionString = @"Provider=MSDAORA.1;Password=tiger;User ID=scott;Data Source=MANOJ" ;
Conn.Open() ;
DA = new OleDbDataAdapter("Select * From Emp", Conn ) ;
DT = new DataTable() ;
DA.Fill(DT) ;
dataGrid1.DataSource = DT ;
//Connection to MS Access.
OleDbConnection Conn ;
OleDbDataAdapter DA ;
DataTable DT ;
Conn = new OleDbConnection() ;
Conn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\Manoj\MyDatabase.mdb" ;
Conn.Open() ;
DA = new OleDbDataAdapter("Select * From EmpInfo", Conn ) ;
DT = new DataTable() ;
DA.Fill(DT) ;
dataGrid1.DataSource = DT ;
Thanks & Regards
Manoj
Re: Connection to Oracle in .Net Framework 1.0
Wht connect though ODBC it's more costly then using the direct method.
?
Re: Connection to Oracle in .Net Framework 1.0
You can download ADO.NET components from Oracle, although it does not mention 8i. I'd download the 9i version and see if that works. The Oracle-specific components will be more efficient and possibly more functional than the more general OleDb.
Re: Connection to Oracle in .Net Framework 1.0
using System.Data.OracleClient;
(reference:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.OracleClient.dll
from Microsoft site, I believe)
If you don't have the reference, I will be glad to send it.
string Hdrstr = "SERVER=SERVERNAME;UId=MYUSERID;Pwd=thepassword";
OracleConnection HdrConn = new OracleConnection(Hdrstr);
HdrConn.Open();
OracleCommand HdrCmd = HdrConn.CreateCommand();
HdrCmd.CommandText = "SELECT H.RID, H.DATE " +
" FROM JOURNAL_ENTRY H " +
" WHERE H.DATE BETWEEN '" + txtFromDate.Text + "' and '" + txtToDate.Text +
"' ORDER BY H.DATE";
OracleDataReader HdrReader = HdrCmd.ExecuteReader();
The Oracle commands are essentially the same as the OleDb commands.
I am using this on Oracle 8i. It works fairly quickly considering the speed of the machine I'm using.
:duck:
Re: Connection to Oracle in .Net Framework 1.0
That's not possible in version 1.0 of the Framework tablazon, as the System.Data.OracleClient namespace wasn't added until version 1.1.
Re: Connection to Oracle in .Net Framework 1.0