G
Guest
Hi Guys,
Basically I'm trying to run a batch sql query but I cannot seem to access
the results from the second sql query. I have simplified the query to help
explain the problem hence why the two queries are the same. Thanks in advance
!
Dim connStr As String = Module1.getString
Dim con As New SqlConnection(connStr)
Dim comm As New SqlCommand
Dim dr As SqlDataReader
con.Open()
comm.CommandText = "Select * from officers; Select * from officers;"
comm.Connection = con
dr = comm.ExecuteReader
dr.Read()
MessageBox.Show(dr(0)) //displays fine
dr.NextResult()
MessageBox.Show(dr(0)) //error thrown saying there is no data in here
Basically I'm trying to run a batch sql query but I cannot seem to access
the results from the second sql query. I have simplified the query to help
explain the problem hence why the two queries are the same. Thanks in advance
!
Dim connStr As String = Module1.getString
Dim con As New SqlConnection(connStr)
Dim comm As New SqlCommand
Dim dr As SqlDataReader
con.Open()
comm.CommandText = "Select * from officers; Select * from officers;"
comm.Connection = con
dr = comm.ExecuteReader
dr.Read()
MessageBox.Show(dr(0)) //displays fine
dr.NextResult()
MessageBox.Show(dr(0)) //error thrown saying there is no data in here