OleDbConnection oleconn = new OleDbConnection();
oleconn.ConnectionString = @"File Name ="+Application.StartupPath+"\chis.udl";
OleDbCommand olecommand = new OleDbCommand();
olecommand.Connection = oleconn;
olecommand.CommandText = "select * from mz_patient_mi";
OleDbDataAdapter oleadapter = new OleDbDataAdapter();
oleadapter.SelectCommand = olecommand;
DataSet ds = new DataSet();
oleadapter.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
oleconn.ConnectionString = @"File Name ="+Application.StartupPath+"\chis.udl";
OleDbCommand olecommand = new OleDbCommand();
olecommand.Connection = oleconn;
olecommand.CommandText = "select * from mz_patient_mi";
OleDbDataAdapter oleadapter = new OleDbDataAdapter();
oleadapter.SelectCommand = olecommand;
DataSet ds = new DataSet();
oleadapter.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
oleconn.Open();
sql语句的参数要使用?,不能使用@