this.dataGridView1.AutoGenerateColumns= true;//设置自动生成列,必须写在InitializeComponent()里
OleDbConnection con1 = data_con1.oleCon();
string sql1 ="selectEmpolyInfo.EName,EmpolyInfo.ECard,EmpolyInfo.ETel,EmpolyInfo.EState,Department.Departname,PostInfo.PPostnamefrom EmpolyInfo,PostInfo,Department whereEmpolyInfo.DId=Department.DId andEmpolyInfo.PId=PostInfo.PId;"
OleDbDataAdapter ad1 = newOleDbDataAdapter(sql1, con1);
DataSet ds1 = new DataSet();
ad1.Fill(ds1);
dataGridView1.DataSour ce = ds1.Tables[0];