I have had this method on a form working fine for several years now:
Code: Select all
private void listProv_SelectedIndexChanged(object sender, EventArgs e) {
listLocation.SelectedItems.Clear();
provNum = GetAnesthProviderNum(listProv.SelectedItem.ToString());
DataTable table = AnesthLocations.RefreshCache();
locationCur = new AnesthLocation();
for (int j = 0; j < table.Rows.Count; j++){
locationCur.LocationNum = PIn.Long(table.Rows[j][0].ToString());
for (int i = 1; i < listLocation.Items.Count + 1; i++){
if (AnesthLocations.GetLocationNumFromProvTable(provNum, locationCur.LocationNum) == true) {
listLocation.SetSelected(j, true);
}
}
}
}
Code: Select all
public static bool GetLocationNumFromProvTable(long providerNum, long locationNum ) {
string command = "SELECT LocationNum FROM anesthprovider WHERE ProviderNum = '" + POut.Long(providerNum) + "' AND LocationNum = '" + POut.Long(locationNum) + "'";
try {
locationNum = Convert.ToInt64(DataCore.GetScalar(command));
return true;
}
catch { return false;}
}
In 17.4 beta, loading the form is now taking 6 seconds. The issue seems to be with this line
Code: Select all
locationNum = Convert.ToInt64(DataCore.GetScalar(command));
UPDATE: Looks like the issue began sometime in 17.3.x branch, perhaps about a week ago