Private Sub Save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim con As New SqlConnection(InvoiceClass.GetConnectionString()) ' My Connection String
con.Open()
For Each item As ListViewItem In Lstview.Items
Dim command As SqlCommand = New SqlCommand("SP_InvoiceSave", con)
command.Parameters.AddWithValue("@ItemName", item.SubItems(0).Text)
command.Parameters.AddWithValue("@Qty", item.SubItems(1).Text)
command.Parameters.AddWithValue("@SellingPrice", item.SubItems(2).Text)
command.CommandType = CommandType.StoredProcedure
command.ExecuteNonQuery();
Next
MsgBox("done")
conn.Close()
End Sub