I am a newbie on c#.I want to bind my sql columns to my dataGridView columns manually. I dont want to assign datatable as below.
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;
DataTable dt = new DataTable();
da.Fill(dt);
dgvAttendance.DataSource = dt;
All I want to bind sql column to datagridview column by calling their name. I want that because I need a dataGridViewCheckBoxColumn to be added on the left of my columns. but if I add that dataGridViewCheckBoxColumn column before assigning the data source, this column take place on 0 index. I need it to be on the right most column.
*I need both of the solution.
You can use
SqlDatareader
instead as follows (assuming you have 3 columns):