Click here to Skip to main content
15,888,803 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
VB
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Try
            Dim i, c As String
            Dim a, b, d As String
            i = ListView1.Items.Count - 1
            While i >= 0
                a = ListView1.Items.Item(i).Text
                b = ListView1.Items.Item(i).SubItems.Item(1).Text
                c = ListView1.Items.Item(i).SubItems.Item(2).Text
                d = ListView1.Items.Item(i).SubItems.Item(2).Text


                Dim QUERY As String
                QUERY = "INSERT INTO sales(id,item name,item description,price,quality,total price)VALUES ('" + a + "','" + b + "','" + c + "')"
                'EXECUTEQUERY(QUERY)
                MsgBox("saved")
            End While
        Catch eEndEdit As System.Exception
            System.Windows.Forms.MessageBox.Show(eEndEdit.Message)
        End Try


    End Sub
End Class
Posted
Updated 22-Apr-13 10:09am
v3
Comments
[no name] 22-Apr-13 15:42pm    
This is not a question or a description of a problem.
ZurdoDev 22-Apr-13 16:33pm    
I'm tired and I refuse to guess what you error is. Would you mind telling us?
db7uk 22-Apr-13 17:11pm    
The error might help. But looking at the code, are you sure you want a space in "item name" and "item description" and "total price"????? you will need to put [] round it surly. i.e. [total price]
StianSandberg 22-Apr-13 17:20pm    
Watch out for sql injections!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900