Hey all,
So hopefully this is a quick fix but for the life of me I can't figure out how to get my results from a OracleDataReader record set.
Just trying to get all the users for a specific TNS into an array. I was able to do this easily before with ADODB, but thought I would try using ODP.net.
Here is what I have so far and it definitely gets all the USERs for a given TNS. its when I get to the READ() part where the syntax is ???
'TNSname, User and password are all variables declared before this
/CODE
Dim oradb As String = "Data Source=" & TNSname & ";User Id=" & User & ";Password=" & password & ";" ' Visual Basic
Dim Inconn As New OracleConnection(oradb) ' Visual Basic
Inconn.ConnectionString = oradb
Inconn.Open()
Dim sql As String = "SELECT USERNAME FROM dba_users where default_tablespace != 'SYSAUX' and default_tablespace != 'SYSTEM' and default_tablespace != 'TOOLS' and default_tablespace != 'USERS' ORDER BY USERNAME" ' Visual Basic
Dim cmd As New OracleCommand(sql, Inconn)
cmd.CommandType = CommandType.Text
Dim inRS As OracleDataReader = cmd.ExecuteReader()
Dim arrTemp() As String = {}
Dim i As Integer = 0
While inRS.Read()
arrTemp(i) = inRS.GetString(0).ToString
i = i + 1
End While
inRS.Close()
Inconn.Close()
/CODE
Its strange as I can easily populate a text or combo box during the read by just saying
While inRS.Read()
cbo_test.items.add(inRS.Item("USERNAME"))
End While
I would appreciate anyones thoughts and or direction here as I would rather not go back to ADOBD...
Thanks ahead of time!
Cheers,
Eric