Click here to Skip to main content
11,639,765 members (65,150 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: VB.NET
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            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 + "')"
            End While
        Catch eEndEdit As System.Exception
        End Try

    End Sub
End Class
Posted 22-Apr-13 9:24am
Edited 22-Apr-13 10:09am
ThePhantomUpvoter at 22-Apr-13 15:42pm
This is not a question or a description of a problem.
ryanb31 at 22-Apr-13 16:33pm
I'm tired and I refuse to guess what you error is. Would you mind telling us?
db7uk at 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]
AlluvialDeposit at 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)

  Print Answers RSS
0 Suvendu Shekhar Giri 330
1 CPallini 177
2 F-ES Sitecore 170
3 himanshu agarwal 167
4 Sergey Alexandrovich Kryukov 159
0 OriginalGriff 9,081
1 Sergey Alexandrovich Kryukov 8,847
2 Mika Wendelius 7,027
3 Suvendu Shekhar Giri 2,650
4 F-ES Sitecore 2,558

Advertise | Privacy | Mobile
Web02 | 2.8.150731.1 | Last Updated 22 Apr 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100