判断Access里是否存在表

  OleDbConnection conn = DbHelper.CreateConnection() as OleDbConnection;
            conn.Open();
            DataTable schemaTable = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, new object[] { null, null, null, "TABLE" });
            conn.Close();
            bool isExistsTable = false;
            foreach (DataRow row in schemaTable.Rows)
            {
                if (row[2].ToString().Equals(tableName))
                {
                    isExistsTable = true;
                    break;
                }
            }


你可能感兴趣的:(object,table,null,Access)