I am trying to read data from this table but it is not returing any values.
Using Con As New SqlConnection(conString)
Con.Open()
Using Com2 As New SqlCommand("SELECT *FROM stop2 WHERE serialno = '" & Barcode.Text & "'", Con)
Using RDR2 = Com2.ExecuteReader()
If RDR2.HasRows Then
RDR2.Read()
Dim time2 As String = "SORRY THIS BOOK HAS NOT BEEN RETURNED IT WAS BORROWED BY " & RDR2.Item("names").ToString() & " Of " & RDR2.Item("class").ToString() & RDR2.Item("stream").ToString()
ScriptManager.RegisterStartupScript(Me, [GetType](), "showalert", "alert('" & time2 & "');", True)
Using Cont As New SqlConnection(conString)
Cont.Open()
Using cmd As New SqlCommand
cmd.Connection = Cont
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "Initiatebarcode"
cmd.Parameters.Add("@c", SqlDbType.NVarChar).Value = Barcode.Text
cmd.Parameters.Add("@ac", SqlDbType.NVarChar).Value = RDR2.Item("Account").ToString()
cmd.Parameters.Add("@d", SqlDbType.NVarChar).Value = Datetr.Text
cmd.ExecuteReader()
Cont.Close()
' Barcode.Text = ""
Exit Sub
End Using
End Using
Barcode.Text = ""
Label15.Text = "BC"
Barcode.Focus()
Exit Sub
End If
End Using
Con.Close()
End Using
End Using
Account |
Bookstaken |
BookName |
markreturned |
serialno |
Class |
stream |
Scancode |
Names |
|
06-00016 |
1 |
GOOD NEWS BIBLE |
0 |
0001 |
NULL |
NULL |
NULL |
KICONCO GERALDINE |
06-00016 |
1 |
GOOD NEWS BIBLE |
0 |
0002 |
NULL |
NULL |
NULL |
KICONCO GERALDINE |
06-00016 |
1 |
GOOD NEWS BIBLE |
0 |
0003 |
NULL |
NULL |
NULL |
KICONCO GERALDINE |
06-00016 |
1 |
GOOD NEWS BIBLE |
0 |
0004 |
NULL |
NULL |
NULL |
KICONCO GERALDINE |
06-00016 |
1 |
GOOD NEWS BIBLE |
0 |
0005 |
NULL |
NULL |
NULL |
KICONCO GERALDINE |
06-00016 |
1 |
GOOD NEWS BIBLE |
0 |
0006 |
NULL |
NULL |
NULL |
KICONCO GERALDINE |
06-00016 |
1 |
GOOD NEWS BIBLE |
0 |
0007 |
NULL |
NULL |
NULL |
KICONCO GERALDINE |