Hi
Don't cut me into pieces for not beeing so clear in this subject. ODBC is new to me so I hope that I can get some help here. I'm trying to to connect to a Oracle database and read the content to a textbox. This is my code:
Connection is ok, (I think) Connection Open shows in textbox, and no errors. But I get a nullexeption on the reader, it has not been assign a value. Don't know what to do next.Code:Dim conn As OdbcConnection Dim connectionString As String Try connectionString = "DSN=***;Driver={Microsoft ODBC for Oracle};Server=***.com;Uid=Bulk;Pwd=pwd;" conn = New OdbcConnection(connectionString) conn.Open() TextBox1.AppendText("Connection Open" & vbCrLf) Dim dbCommand As System.Data.OracleClient.OracleCommand Dim dbDataReader As System.Data.OracleClient.OracleDataReader dbDataReader = dbCommand.ExecuteReader() Do While dbDataReader.Read() TextBox1.AppendText(dbDataReader(0).ToString & vbCrLf) Loop Catch ex As Exception MessageBox.Show(ex.ToString) End Try




Reply With Quote