strange idea to keep the table names as a enumeration. Why not to use the string array like:
string [] TablesGeometriesMDB = new string[]
{
"chain",
"link",
"link_coords",
"node",
"point",
"simple_area",
"simple_area_coords",
"simple_chain",
"simple_chain_coords",
"simple_point",
"text"
};
string [] TablesDesignObjectsMDB = new string[]{"drawings", "projects"};
void GetData(string strSelectedMDB)
{
switch(strSelectedMDB) {
case "geometries":
GetDataFromDB(TablesGeometriesMDB);
break;
case "objects":
GetDataFromDB(TablesDesignObjectsMDB);
break;
}
}
void GetDataFromDB(string[] tables)
{
OleDbConnection con = new OleDbConnection(...):
con.Open();
foreach (string table in tables)
{
strSQL = string.Format("SELECT COUNT(*) FROM [{0}]", table);
OleDbCommand cmd = new OleDbCommand(strSQL, con);
int cnt = Convert.ToInt32(cmd.ExecuteScalar());
lstOutput.Items.Add(string.Format("{0}: ", table, cnt);
ICountMDBObjects += cnt;
}
lstOutput.ScrollIntoView(lstOutput.Items.GetItemAtlstOutput.Items.Count - 1));
con.Close();
con.Dispose();
}