【发布时间】:2020-03-02 21:35:25
【问题描述】:
I want to put the Record in a column of days;每一列天必须有自己的状态 图片显示了一切 datagridview whit day
DataTable dt = new DataTable();
DataTable dt1 = new DataTable();
//this line of code used to connect to the server and locate the database (usermgt.mdb)
static string connection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " + Application.StartupPath + "/Med11.mdb";
OleDbConnection conn = new OleDbConnection(connection);
string sql = "Select matricule ,statut,day from Table1";
OleDbDataAdapter da = new OleDbDataAdapter(sql, conn);
string sql1 = "Select statut from Table1 where idengin=1";
OleDbDataAdapter da1 = new OleDbDataAdapter(sql1, conn);
da.Fill(dt);
da1.Fill(dt1);
// dataGridView1.Columns["Old Column Name"].HeaderText =dt;
dataGridView1.Columns[0].Name = "Matricule";
dataGridView1.Columns[0].HeaderText = "Matricule";
dataGridView1.Columns[0].DataPropertyName = "matricule";
if (dataGridView1.Columns[5].Visible)
{
//this.dataGridView1.Rows[3].Cells[0].Value = "new value";
// dataGridView1.Columns[6].DataPropertyName = "day";
/// dataGridView1.Rows[2].Cells[2].Value = "day";
}
【问题讨论】:
标签: c# database ms-access datagridview