This is silly code:
That's not what a Select Case is for. That would properly be written as:Code:Select Case True Case Det01 = "True" ccb01DetOverride.Checked = True Case Else ccb01DetOverride.Checked = False End Select
or, even more simply:Code:If Det01 = "True" Then ccb01DetOverride.Checked = True Else ccb01DetOverride.Checked = False End If
You can easily set a breakpoint on the appropriate line and check the value of Det01 right as it's being used. A possible reason that it may not work as expected is that there is actually a space at the end of the text. Of course, if you want to store Boolean values in SQL Server then you should be using the bit data type rather than nvarchar if at all possible, but there may be a valid reason that that is not possible.Code:ccb01DetOverride.Checked = (Det01 = "True")




Reply With Quote
