DataGridViewComboboxColumn
ds = new DataSet(); da = new SqlDataAdapter("select * from holiday", con); da.Fill(ds, "holiday"); DataTable tab = ds.Tables[0]; MessageBox.Show(ds.Tables[0].Rows.Count.ToString()); int i = 0; foreach (DataRow row in tab.Rows) { dataGridView1.Rows.Add(); //MessageBox.Show(row[0].ToString()); dataGridView1[0, 1].Value=row[0].ToString(); dataGridView1[1, i].Value = row[1].ToString(); dataGridView1[2,i].Value = row[2].ToString(); i++; }
DataSet
DataTable
DataSource
ValueMember
DisplayMember
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)