我创建了一个简单的 oracle 表,我正在尝试连接到 VB.net
我可以连接,但无法向表中添加任何记录。我收到消息:ORA-00903:无效的表名。
这是我创建表的 Oracle 数据库管理器的预览屏幕。
Oracle Enterprise Manager 屏幕截图(抱歉是法语)
这是我正在使用的代码:
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
谢谢。