附件:http://files.cnblogs.com/xe2011/MDB_BindingSource.rar
using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Data; using System.Data.Common; using System.Data.OleDb; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { string connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=MangerDataBase.mdb"; string query = "SELECT * FROM ScoreInfo"; OleDbDataAdapter dAdapter = new OleDbDataAdapter(query, connString); OleDbCommandBuilder cBuilder = new OleDbCommandBuilder(dAdapter); DataTable dTable = new DataTable(); dAdapter.Fill(dTable); BindingSource bSource = new BindingSource(); bSource.DataSource = dTable; dataGridView1.DataSource = bSource; dAdapter.Update(dTable); } } }