How to access Oracle using ODP. NET (how to access Oracle using. net)

Source: Internet
Author: User
Tags oracleconnection

Step 1: Get the class library file that supports database connection:Oracle. DataAccess. dllHow to obtain it?

Oracle. DataAccess. dll, Copy it to yourReference under Solution

Oraprovcmd.exeEnvironment variables are automatically configured (figure 2)

Step 2: Before official use, add reference to the project:

Oracle. DataAccess. ClientSet database connections and other general functions,

Oracle. DataAccess. TypesSet custom oracle Data Types

Step 3: Instance description




) (HOST =192.168.10.20) (= 1521) "+
) (SERVICE_NAME =44347g242); User Id =44 bikll; Password =487gf,. q;";

) (HOST =192.168.10.20) (= 1521) "+
44347g242); User Id = 44 bikll; Password =487gf,. q;";

TBLOCKLOG and TBACCOUNT

Main (Test Database conString = +; (OracleConnection conn = SQL = + = (OracleCommand comm = (OracleDataReader rdr = + rdr. getString () ++ rdr. getInt32 () ++ rdr. getInt32 () ++ rdr. getDateTime (, Convert. toDateTime (), Convert. toDateTime (GetBillByDateAndGameId (conString, accountId, (OracleConnection conn = accountId. toLower (); conn. open (); SQL ==+ gameId ++ accountId ++ beginTime ++ endTime + (OracleCommand comm = (OracleDataReader rdr = comm. executeReader () sum = (rdr. read () (rdr. getOracleValue (). toString () =. parse (rdr. getOracleValue (-

1. Create a database


Insert a row of data

:

If (rdr. GetOracleValue (0). ToString () = "null") // prevent null

.

Step 4: Deployment instructions

Sqlplus/nolog to know the version

My results:


 

SupplementAmong them, 11.2.0.3.50 Beta will be more suitable for quick Oracle operations, but the support of win7 and. NET Framework 4 is required. Generally, enterprises have not considered win7 as a server!

Happy Dragon Boat Festival!

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.