Use oledb to connect to the Oracle database

Source: Internet
Author: User

PreviousArticleIs a demo about using oracleclient to access the Oracle database,

However, it seems that Microsoft has declared that it will give up its support for oracleclient since. Net 4.0,

So the following blog will introduce more methods for. Net accessing the Oracle database,

In fact, there are many ways to access the Oracle database, such as using ODBC,

Or oracleclient implementation, or oledb implementation,

Or through ORACLE data provider for. Net (ODP. net) provided by Oracle,

For the last ODP. net, you must add the components provided by Oracle,

Another interesting thing is that Oracle Developer Tools for Visual Studio provided by Oracle,

After installation, you can directly access the Oracle database in Visual Studio like SQL Server,

However, this blog post will only introduce oledb,

From ease to difficulty, we will introduce other methods for accessing the Oracle database later,

In fact, using oledb to access the Oracle database is very simple, just like using oracleclient in the previous blog,

Only some basic methods and classes are different, and then the connection string to the database is slightly changed,

It is also worth mentioning that when oracleclient accesses the Oracle database,

There is no need for too many data types in Oracle databases,

In oracleclient, there are some methods for getting values for Oracle Database types,

For example

When accessing oracle in oledb, you must control the data type conversion,

For example

Now let's take a look at the demo,

Let's take a look at the connection string first.

This demo achieves the same effect as the demo used to access the Oracle database using oracleclient in the previous article,

You can also log on with Scott and access the EMP data table in the database to obtain the data,

From the above we can see that this demo and the previous demo have no changes,

However, the following blog posts about how to access the Oracle database will be a little more complicated !!!

 

 

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.