码迷,mamicode.com
首页 > 数据库 > 详细

C# Access

时间:2015-08-10 09:28:03      阅读:174      评论:0      收藏:0      [点我收藏+]

标签:

数据库连接语句:

<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

版权声明:本文为博主原创文章,未经博主允许不得转载。

C# Access

标签:

原文地址:http://blog.csdn.net/ilipan/article/details/47393213

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!