尝试使用OracleDataReader时出现vb.net错误

时间:2017-06-18 20:31:45

标签: vb.net oracle visual-studio-2015

我正在尝试从Oracle Sql Developer服务器获取数据。连接正常但我似乎在尝试从数据库获取实际数据时遇到问题。我一直收到以下错误:    {" ORA-00942:表或视图不存在"}

我使用的代码如下:

Public connectionString As String
Public sqlCom As String
Public command As New OracleCommand
Public con As New OracleConnection
Public dr As OracleDataReader
connectionString = "Data Source=orcl; User Id=system; Password=parola1234;"
con = New OracleConnection(connectionString)
Try
    con.Open()
    ''MessageBox.Show("succes")
Catch ex As Exception
    MessageBox.Show(ex.ToString)
End Try
command.Connection = con
sqlCom = "select TICKETID from system.TICKETS where TICKETID = " + txtTicket.Text
command.CommandText = sqlCom
dr = command.ExecuteReader()
If (dr.HasRows) Then
   While (dr.Read())
       Me.Hide()
       GlobalVariables.ticketNOText = txtTicket.Text
       Tracking.Show()
   End While
Else
MessageBox.Show("Invalid Ticket Number!")
End If

这是我的SQL DB的图片: 1

0 个答案:

没有答案