Private Sub lvUnavailableProducts_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles lvUnavailableProducts.SelectedIndexChanged
Dim cmd As SqlCommand = New SqlCommand("SELECT * FROM Product_Suppliers WHERE ProductCode = '" & lvUnavailableProducts.SelectedItems(0).SubItems(0).Text & "'", conn)
conn.Open()
Dim sdr As SqlDataReader = cmd.ExecuteReader()
If sdr.Read = True Then
Fill("SELECT DISTINCT SupplierCode, SupplierName FROM Product_Suppliers WHERE ProductCode ='" & lvUnavailableProducts.SelectedItems(0).SubItems(0).Text & "'", lvProductSupplier)
conn.Close()
Else
MsgBox("No added Supplier Yet, Please add a supplier")
lvProductSupplier.Items.Clear()
conn.Close()
End If
End Sub
Я обнаружил ошибку при изменении выбранных данных на LvUnavailableProducts
Пожалуйста, помогите Спасибо: D