foreach (DataGridViewRow row in dtstudent.Rows) { getbatchid(); DataGridViewCheckBoxCell cell = row.Cells["PRESENT"] as DataGridViewCheckBoxCell; ClsConnection.Conn.Close(); if (cell.Value != null) { //MessageBox.Show(row.Cells[0].Value.ToString()); string s = row.Cells[0].Value.ToString(); string str11 = ""; string bat_date = dateTimePicker1.Value.ToString("dd/MM/yyyy"); str11 = "insert into tbbatch_att(batch_id,student_id,staff_id,attendance_date)values(" + batchid + "," + s + "," + staffid + ",'" + bat_date + "')"; SqlCommand cmd11 = new SqlCommand(str11, ClsConnection.Conn); ClsConnection.Conn.Open(); cmd11.ExecuteNonQuery(); ClsConnection.Conn.Close(); }
int numVal = Convert.ToInt32(yourstring);
int num = int.Parse(text);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)