windows.forms.combobox always returns 1 when run compiled on a Windows 10 machine. It returns the correct answer in the development environment and compiled and run on a Windows 7 virtual machine.
Program is compiled as 'any cpu'. It complains about one project that it references that is compiled for x86
Private Sub LoadLocations()
'gets locations that this provider is registered with HIC, either in or out of hospital
Dim snpFee As DataTable
Dim sql As String
sql = $"SELECT L.counter, L.LocationName
FROM Providers as P INNER JOIN Locations as L ON P.ctrLocation = L.counter
WHERE (L.loc_Hidden = 0 Or L.loc_Hidden Is Null)
AND (P.ProviderNumber <> ''
AND Not P.ProviderNumber Is Null)
AND P.ctrUser = {mctrUser}"
If mInHospital Then
sql &= " AND loc_HICTreatmentLocationCde = 'H'"
lblLocation.Text = "Location (In Hospital)"
Else
sql &= " AND loc_HICTreatmentLocationCde <> 'H'"
lblLocation.Text = "Location (Out of Hospital)"
End If
sql &= " ORDER BY L.counter DESC"
snpFee = mSPMDA.GetSQLDatatable(sql)
If Not snpFee Is Nothing AndAlso snpFee.Rows.Count > 0 Then
cmbLocations.DataSource = snpFee
cmbLocations.ValueMember = "counter"
cmbLocations.DisplayMember = "LocationName"
cmbLocations.SelectedValue = mctrLocation
Else
lblMsg.Text = mSPMDA.ErrMessage
End If
cmbLocations.Refresh()
End Sub
Private sub SaveInformation
.
.
.
.
If cmbLocations.SelectedIndex = -1 Then
cmbLocations.SelectedIndex = 0
End If
If IsNumeric(cmbLocations.SelectedValue) Then
mctrLocation = CInt(cmbLocations.SelectedValue)
Else
mctrLocation = 0
End If
.
.
.
End Sub