This code is working if my listview has only 1 row. But if the listview has two or more rows, it double~triple etc.
foreach(ListViewItem ItemRow in this.listViewPOS.Items)
{
for (int i = 0; i < listViewPOS.Count; i++)
{
SQLConn.sqL = "INSERT INTO OrderDetails(ProductID, OrderID, SRP, Quantity, Discount, Total) VALUES('" + ItemRow.SubItems[0].Text + "'," +
"'" + OrderID + "', '" + ItemRow.SubItems[3].Text + "', '" + ItemRow.SubItems[4].Text + "', '" + ItemRow.SubItems[5].Text + "', '" + ItemRow.SubItems[6].Text + "')";
SQLConn.ConnDB();
SQLConn.cmd = new SqlCommand(SQLConn.sqL, SQLConn.conn);
SQLConn.cmd.ExecuteNonQuery();
}
}