C# 连接ACCESS数据库

OleDbConnection Con = new OleDbConnection(Provider=Microsoft.Jet.OLEDB.4.0;Data Source= + 门店QQ.mdb + ;Persist Security Info=False); OleDbDataAdapter myda = new OleDbDataAdapter(SEL...

OleDbConnection Con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + "门店QQ.mdb" + ";Persist Security Info=False");
OleDbDataAdapter myda = new OleDbDataAdapter("SELECT * from QQ where 门店名称 like'%" + textBox1.Text.ToString().Trim() + "%' or 区域 like'%" + textBox1.Text.ToString().Trim() + "%' or 事业部 like'%" + textBox1.Text.ToString().Trim() + "%' order by 事业部,区域,门店名称 ",Con);
DataSet myds = new DataSet();
myda.Fill(myds, "联系门店QQ");
dataGridView1.DataSource = myds.Tables[0].DefaultView;

本文标题为:C# 连接ACCESS数据库

基础教程推荐