FSharp calls Oracle. ManagedDataAccess. dll, fsharp
FSharp calls Oracle. ManagedDataAccess. dll
1. Oracle. ManagedDataAccess. dll. It seems that you have to register for download. Even a 64-bit system requires a 32-bit version;
2. You also need to reference System. Data, System. Transaction, and System. Xml.
The Database in the program is Oracle Database 11g Express Edition.
# If INTERACTIVE
# R @ "C: \ oracle \ odp.net \ managed \ common \ Oracle. ManagedDataAccess. dll"
# Endif
Open Oracle. ManagedDataAccess. Client
Open Oracle. ManagedDataAccess. Types
Open System. Data
Let connStr = "user id = hr; password = hr; data source = xe"
Let conn = newOracle. ManagedDataAccess. Client. OracleConnection (connStr)
Conn. Open ()
Printfn "% s" conn. ServerVersion
Let cmd = conn. CreateCommand ()
Cmd. CommandType <-CommandType. Text
Cmd. CommandText <-"select * from jobs"
Let da = newOracle. ManagedDataAccess. Client. OracleDataAdapter (cmd)
Let table = new System. Data. DataTable ()
Let cnt = da. Fill (table)
Table. Columns. [0]
Table. Rows. [0]
Table. Rows. [0]. [0]