Connect to Oracle Database

Source: Internet
Author: User
Tags odbc connection

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]"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.