Hi All,
I got the solution finally.
for (int i = 0; i < dtgrdUnconfirm.Rows.Count; i++)
{
DataGridViewCheckBoxCell clmSelect = new DataGridViewCheckBoxCell();
clmSelect = (DataGridViewCheckBoxCell)dtgrdUnconfirm.Rows[i].Cells[0];
if (clmSelect.Value != null &&
Convert.ToBoolean(clmSelect.Value) == true)
{
data += (dtgrdUnconfirm.Rows[i].Cells[6].Value.ToString())+",";
}
}
data = data.TrimEnd(',');
if (lstbxUnconfirm.SelectedItem.ToString() == "ID")
{
updatesql = "update tablename set Confirmed=0 where id in (" + data + ")";
}