I have datagridview have check boxes checked
but my problem how to update checked box values from datagridview in database .
button1_click event
{
string subjId;
List<string> lines = new List<string>();
for (int i = 0; i < gvSubjectsList.Rows.Count; i++)
{
bool Ischecked =Convert.ToBoolean(gvSubjectsList.Rows[i].Cells["Select"].Value);
if (Ischecked == true)
{
subjId = gvSubjectsList.Rows[i].Cells["SubjectId"].Value.ToString();
lines.Add(subjId);
}
}
//update courses set courseStatus = true where subjId found in lines
}
my problem how to
//update courses set courseStatus = true where subjId found in lines
How to write query select in c# to get what numbers found in list ?
update courses set courseStatus = true where ??????
what i write in place of ?????????
thanks