/// <summary>
/// 获取Access数据库中的所有用户表的名称
/// </summary>
/// <returns></returns>
public static List<string> GetUserTableNames()
{
OleDbConnection connection = new OleDbConnection(AccessHelper.ConnectionString);
connection.Open();
DataTable table = connection.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, new object[] { null, null, null, "Table" });
connection.Close();
List<string> tableNames = new List<string>();
foreach (DataRow item in table.Rows)
{
tableNames.Add(item[2].ToString());
}
return tableNames;
}