Reading an Oracle database in a C # application

Source: Internet
Author: User

Objective

The most recent task is to develop a feature that reads the data from the vendor and then takes it and processes it back into our own database. The supplier is the Oracle database, but I think it's all about the data anyway, so I started. Because of the blog at home, those are placed in the company's computer, hope to be able to understand through the text, more than the poor also please forgive.

Process

The first method: At first I was using the System.Data.OracleClient in. NET; And then put the Oracle client installed, the result is not. The Oracle client is loaded in a timely version. After the execution of continuous error, what can not be marked, the version of how much more than, and so on these issues. No way, and finally in the second way to solve.

    Second method: oledb , a search on the internet will see a lot, the difference is that the link string added a driver pointing to the sign is Oracle, provider= ... , then executes the program, or an error. The fault of the report is that there is no program provided. After checking online, it is necessary to install a component. After downloading, install. then debugging or not.

Then asked the others, basically it is such a operation. But why not, they say there's a test configuration, but I can't find it on my machine. Because the client I loaded in a timely version, and then I re-loaded again, selected an administrator version. The final test configuration comes out, configure the server name on the test, then add the IP to connect to, then the database, the account password. Finally click on the "Test" button. The connection is displayed successfully. Finally, the first method was returned. But the connection is still reported abnormal. Finally, we consulted one of our former buddies, and he said he did it. Why not? He cut me a picture and I found a different place. The DataSource of the connection string is the name of the server in which we tested the successful connection, that is, our own name. That's the point. To think about it, it is necessary to use the name of the client test, just to connect the string to a block. It's finally done. But the second method is still not done, because in the online look, they say the first method, read the time will be garbled, with the second method is not. So the second method, sooner or later, will have to be done.

Summarize

What you have to try to understand the deeper, although a very simple thing, failed many times, in fact, each time the failure is not a failure, but also a success, because it lets you know that this way does not work, it is also a kind of gain. So we should not be afraid of failure, this is why failure is the mother of success. No, it seems monotonous a lot, the expression does not appear vivid, or please forgive me a lot.

Even if you fall 100 times, you have to stand up 100 times.

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.