连接Access数据库

            string strPath = Application.StartupPath + "\\DataBase\\AccessDB.mdb";
            OleDbConnection con = new OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;data source='"+strPath+"'");
            OleDbDataAdapter oda = new OleDbDataAdapter("Select * from tb_Student", con);
            DataSet ds = new DataSet();
            oda.Fill(ds);
            dataGridView1.DataSource = ds.Tables[0].DefaultView;

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-18
  • 2021-12-13
  • 2022-02-25
  • 2022-02-04
  • 2021-07-11
猜你喜欢
  • 2022-02-20
  • 2021-10-26
  • 2022-12-23
  • 2021-10-28
  • 2021-11-18
  • 2021-07-03
  • 2021-05-27
相关资源
相似解决方案