Dim connectstr As String = "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=IP)(PORT=1521))(CONNECT_DATA=(SID=ORCL)));User Id=用户名;Password=密码;"
'数据库连接
Dim con As New Oracle.ManagedDataAccess.Client.OracleConnection(connectstr)
con.Open()
'创建查询对象
Dim sql As String = "查询语句"
Dim cmd As New Oracle.ManagedDataAccess.Client.OracleCommand(sql, con)
Dim oda As New Oracle.ManagedDataAccess.Client.OracleDataAdapter(cmd)
Dim dt As New System.Data.DataTable
oda.Fill(dt)
Return dt