新手求助求助、坐等、、
数据库中我就插入了一条数据,都是11的、、
-----------------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim strSql As String
strSql = "select * from student where num='11'" ' & TextBox1.Text
Dim sqlconnStr As String
sqlconnStr = "Data Source=***;user=system;password=***"
Try
Dim SqlConn = New System.Data.OracleClient.OracleConnection(sqlconnStr)
MsgBox("start")
SqlConn.open()
Dim sqlcmd As System.Data.OracleClient.OracleCommand = New System.Data.OracleClient.OracleCommand(strSql, SqlConn)
Dim dr As System.Data.OracleClient.OracleDataReader
dr = sqlcmd.ExecuteReader()
MsgBox("11")
If dr.Read() Then
MsgBox("ok")
Else
MsgBox(dr.Read())
MsgBox("error11")
End If
SqlConn.close()
Catch
MsgBox("error")
End Try
End Sub
-------------------------
dr读不到数据、、
我百度好久、就是不知道要怎么弄、、、在线坐等、、、
------解决方案--------------------
SQL code
--你手动插入的吧,插入后commit下,然后程序中才读得到
select * from student where num='11'
--这句拿到数据库中执行看有没有结果