即使是 64 位系统,也要注册 32 位版本。
#if INTERACTIVE
#r@"C:\oracle\odp.net\managed\common\Oracle.ManagedDataAccess.dll"
#endif
openOracle.ManagedDataAccess.Client
openOracle.ManagedDataAccess.Types
open System.Data
let connStr ="userid=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]