数据库连接语句:
<span style="font-size:12px;"> string path = @"E:\Users\PanLee\Desktop\Access .accdb"; OleDbConnection oleDbConnection = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.15.0;data source=" + path); oleDbConnection.Open(); string sql = "select * from Student"; OleDbDataAdapter oleDbDataAdapter = new OleDbDataAdapter(sql, oleDbConnection); DataTable dataTable = new DataTable(); oleDbDataAdapter.Fill(dataTable); dataGridView1.DataSource = dataTable;</span>
http://www.jb51.net/article/45197.htm
版权声明:本文为博主原创文章,未经博主允许不得转载。
时间: 2024-10-06 13:19:09