string sql = "UPDATE itmscat1 SET [itmcount] = [itmcount] + @itmcount WHERE [itmcode] = @itmcode"; cm.CommandText = sql; foreach (ListViewItem item in listView1.Items) { cm.Parameters.Clear(); cm.Parameters.Clear(); SqlParameter par_ItmCount = new SqlParameter("@itmcount", SqlDbType.Int); par_ItmCount.Value = item.SubItems[4].Text; cm.Parameters.Add(par_ItmCount); SqlParameter par_ItmCode = new SqlParameter("@itmcode", SqlDbType.Int); par_ItmCode.Value = item.SubItems[1].Text; cm.Parameters.Add(par_ItmCode); { cm.ExecuteNonQuery(); } }
par_ItmCode.Value = Convert.ToInt16(Item.SubItems[4].Text);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)