不说了直接上代码:

try{

String str = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" + address + "'";
con = new OleDbConnection(str);
con.Open();
OleDbCommand cmd = con.CreateCommand();

//获得数据

OleDbDataAdapter dagroup = new OleDbDataAdapter("select DATA_NAME from BL_BUILD group by DATA_NAME ", con);
DataSet dsgroup = new DataSet();
dagroup.Fill(dsgroup, "ddgroup");

//执行sql  语句

cmd.CommandText = item;
 int num = cmd.ExecuteNonQuery();

 con.Close();

}

catch (Exception ex)
{
con.Close();
con.Dispose();
throw ex;
}

  喜欢给我留言哦

相关文章:

  • 2021-07-27
  • 2022-02-28
  • 2022-12-23
  • 2022-12-23
  • 2021-10-02
  • 2022-12-23
  • 2021-04-14
  • 2022-01-20
猜你喜欢
  • 2022-12-23
  • 2021-06-24
  • 2022-12-23
  • 2021-11-28
  • 2021-10-30
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案