vs2008中怎么把dataset里的数据绑定到datagridview控件显示出来
展开全部
OleDbConnection con = new OleDbConnection("Provider=Microsoft.ace.OLEDB.12.0;Data Source=E:\\LianxiDatabase.accdb");
con.Open();
OleDbDataAdapter dad = new OleDbDataAdapter("Select * from students", con);
DataSet dst = new DataSet();
dad.Fill(dst, "students");
con.Close();
this.dataGridView1.DataSource = dst.Tables[0];
con.Open();
OleDbDataAdapter dad = new OleDbDataAdapter("Select * from students", con);
DataSet dst = new DataSet();
dad.Fill(dst, "students");
con.Close();
this.dataGridView1.DataSource = dst.Tables[0];
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询