Trying to find a way as to how can i display a message box to say stock not available when i link it to my database to show that the quantity_available of the album( typed in and is refered to by the album_id in the textbox) ?
here is my coding that i have tried bt not working everytime i type an album's id that as value in its quantity_availalbe coloumn:
Dim con As New SqlClient.SqlConnection("Data Source=CHETS-TOSHIBA\SQLEXPRESS;Initial Catalog=PlanetDiscLibrary;Integrated Security=True")
Dim sqls As String = "Select * from album where album_id='" + txtAID.Text + "' and quantity_available < 1 "
Dim cmd As New SqlClient.SqlCommand(sqls, con)
con.Open()
Dim QA As Integer = cmd.ExecuteNonQuery()
con.Close()
If QA < 0 Then
MessageBox.Show("Album is out of stock", "AlbumError", MessageBoxButtons.OK, MessageBoxIcon.Error)
txtAID.Text = ""
Return False
End If
Return True