pede po ba magpaturo...
ano po ba ang error ng codes na ito..
Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click
Dim da As New SqlClient.SqlDataAdapter
Dim ds As New DataSet
Dim sql As String
'Dim sqlarr(lstviewRentalSummary.Items.Count) As String
Dim entry(lstviewRentalSummary.Items.Count, lstviewRentalSummary.Columns.Count) As String
Dim x As Integer
Dim y As Integer
For x = 0 To lstviewRentalSummary.Items.Count - 1
'sqlarr(x) = "SELECT availability FROM video WHERE videoid= '" & lstviewRentalSummary.Items(x).SubItems(2).Text & "'"
For y = 0 To lstviewRentalSummary.Columns.Count - 1
entry(x, y) = Trim(lstviewRentalSummary.Items(x).SubItems
.Text)
Next
'da = New SqlClient.SqlDataAdapter(sqlarr(x), cnn)
'da.Fill(ds, "video")
sql = "UPDATE video SET availability='FALSE' WHERE videoid= '" & lstviewRentalSummary.Items(x).SubItems(2).Text & "'"
execute_query(sql)
sql = "INSERT INTO customer_video (customerid,videoid,duedate,dateissue) VALUES ('" & entry(x, 0) & "', '" & entry(x, 2) & "', '" & entry(x, 7) & "', '" & entry(x, 8) & "')"
execute_query(sql)
sql = "INSERT INTO transaction VALUES ('" & entry(x, 0) & "', '" & entry(x, 2) & "', '" & txtCash.Text & "', '" & txtChange.Text & "', '" & entry(x, 8) & "')"
'(customerid,videoid,cash,change,dateissue)
execute_query(sql)
Next
MsgBox("Transaction Finish", MsgBoxStyle.Information)
End Sub
Private Sub execute_query(ByVal val As String)
Dim objcommand As New SqlClient.SqlCommand
cnn.Open()
objcommand = New SqlClient.SqlCommand
objcommand.Connection = cnn
objcommand.CommandText = val
objcommand.ExecuteNonQuery()
cnn.Close()
End Sub