I need to execute a sql statement based on the boolean value in the column, ExemptSuperviors, however the value is not being written to the grid. Hence, I am not getting the value for the sql statement. How can I resolve this issue, please.
Even the boolean value cannot be displayed, I do need it for the sql statement.
I have:
' ExemptSupervior
.Columns.Add(New Infragistics.WebUI.UltraWebGrid.UltraGridColumn)
With .Columns(.Columns.Count - 1).Hidden = False.Header.Caption = "ExemptSupervior".Width = 25.IsBound = True.BaseColumnName = "ExemptSupervior".Key = "ExemptSupervior"End With
Along with:If e.Row.Cells(e.Row.Cells.IndexOf("ExemptSupervisor")).Value = "-1" Then <= Level of error
If (e.Row.Cells(e.Row.Cells.IndexOf("LunchTime")).Value = "3") Then do some stuff Else If (e.Row.Cells(e.Row.Cells.IndexOf("LunchTime")).Value = "6") Then do some other stuff End
The "bit" datatype in SQL Server 2005 is the right value to use as a boolean value. What I don't understand at this stage is why it's being pulled into your .NET data source as a number value, since I'd expect it to be pulled in as an actual boolean value (as in the System.Boolean data type).
What kind of object are you using to pull the data into .NET? Can you confirm what data type is being used in that object for this field?
Good Morning,
The underlying data base is SQL Server 2005. Notably, there is no option to select Boolean hence I have been using "bit" when I needed a "True" "False" data option. Which was not an issue within Visual Studio, but the same value does not write to the UltraWebGrid.
What is the underlying database? Is it SQL Server 2005, SQL Server 2008, or something else?
I double-checked the data type is "bit".
I think we need to cross the bridge of "what .NET data type do you have?" first. A value of -1 is clearly not a boolean value, so I don't know what behavior to expect.