Copy the System. Data. OralceClient. dll file to the Bin directory of the project directory, which is usually located in the C:/windows/Microsoft. NET/Franmework/v.1.1.4322 directory.
// Connection string
String Oracle_ConnStr = "Data Source = Oracle9i; Integrated Security = yes ";
// Create an OralceConnection object
OralceConnection Conn = new OralceConnection (Oracle_ConnStr );
Try
{
Conn. Open ();
Label1.Text = "connecting to Oralce Database ";
}
Catch (Exception ex)
{
Label1.Text = ex. ToString ();
}
Finally
{
// Close the database connection
Conn. Close ();
}
// Oracle Database ODBC connection string
String ODBC_Conn = "Driver = Microsoft ODBC for Oracle; Server = OracleServer. Name; Uid = username; Pwd = password ;";
// Oracle Database OLEDB connection string
String OLEDB_Conn = "Provider = OraOLEDB. Oracle; Data Source = myOracleDB; User Id = username; Password = password ;";
Author "Darren [never abandon]"