protected void btnEtDeleteTable_onClick(object sender, EventArgs e) { MetadataNewDa MNDa = new MetadataNewDa(); bool okToDelete = true; int tableId = int.Parse(ddlTableDefs.SelectedValue); okToDelete = !MNDa.TableHasDataSavedInVirtualMetaField(tableId); if (okToDelete) { viewMode = "start"; setViewMode(); MNDa.DeleteMetaTableAndAssociatedData(tableId); ddlTableDefs.SelectedIndex = 0; loadTableDefs(); } else { viewMode = "errorMessage"; setViewMode(); lblErrorHeading.Text = "Could not delete meta table"; lblErrorMessage.Text = "One or more virtual meta field in the selected meta table has data saved in a virtual table. The meta table was not deleted."; } }