.Net to Oracle Connectivity using ODBC .NET

Posted by SAMIR BHOGAYTA on Samir ASP.NET with C# Technology See other posts from Samir ASP.NET with C# Technology or by SAMIR BHOGAYTA
Published on 2011-03-15T07:57:00.001-07:00 Indexed on 2011/03/15 16:18 UTC
Read the original article Hit count: 595

You can use the new ODBC .NET Data Provider that works with the ODBC Oracle7.x driver or higher. You need to have MDAC 2.6 or later installed and then download ODBC .NET from the MS Web Site http://msdn.microsoft.com/downloads/default.asp?url=/code/sample.asp?url=/msdn-files/027/001/668/msdncompositedoc.xml&frame=true. MDAC (Microsoft Data Access Component) 2.7 contains core component, including the Microsoft SQL server and Oracle OLE Database provider and ODBC driver. Insta ...You can use the new ODBC .NET Data Provider that works with the ODBC Oracle7.x driver or higher. You need to have MDAC 2.6 or later installed and then download ODBC .NET from the MS Web Site http://msdn.microsoft.com/downloads/default.asp?url=/code/sample.asp?url=/msdn-files/027/001/668/msdncompositedoc.xml&frame=true. MDAC (Microsoft Data Access Component) 2.7 contains core component, including the Microsoft SQL server and Oracle OLE Database provider and ODBC driver. Install ODBC .NET from the MS Web Site http://msdn.microsoft.com/downloads/default.asp?URL=/downloads/sample.asp?url=/msdn-files/027/001/943/msdncompositedoc.xml Create a DSN, using either Microsoft ODBC for Oracle or Oracle supplied Driver if the Oracle client software is loaded. here for eq. TrailDSN. While creating DSN give user name along with passward for eq. scott/tiger.

using Microsoft
.Data.Odbc;

private void Form1_Load(object sender, System.EventArgs e)
{
try
{
OdbcConnection myconnection= new OdbcConnection ("DSN=TrialDSN");
OdbcDataAdapter myda = new OdbcDataAdapter ("Select * from EMP", myconnection);
DataSet ds= new DataSet ();
myda.Fill(ds, "Table");
dataGrid1.DataSource = ds ;
}
catch(Exception ex)
{
MessageBox.Show (ex.Message );
}
}


© Samir ASP.NET with C# Technology or respective owner

Related posts about .Net to Oracle Connectivity using ODBC .NET