I have created a simple oracle table that I'm trying to connect to VB.net
I'm able to connect but I can't add any record to the table. I'm receiving the message: ORA-00903: Invalid table name.
Here's the preview screen of my Oracle Database Manager from which I created the table.
Oracle Enterprise Manager screenshot (Sorry it's in french)
Here is the code I'm using:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Oracle = New OracleObject("192.128.7.15", 1521, "TechnicalDatabase", "system", "admin")
If Oracle.Connect = False Then
Exit Sub
End If
Dim Sql As String
Sql = "INSERT INTO USER (ID, FirstName) values ('1','Jim');"
Oracle.ExecuteSubQuery(Sql)
Oracle.Disconnect()
End Sub
Public Function ExecuteSubQuery(ByVal SQL As String) As Boolean
Dim Command As New OracleCommand(SQL, Connection)
Command.CommandType = CommandType.Text
Try
Command.ExecuteReader()
Catch ex As Exception
MsgBox("Error in query !" & Chr(13) & ex.Message)
Return False
End Try
Return True
End Function
Thanks.