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!