S
Sparky Arbuckle
I am using the IIF function in my application to create an instance and
value of a field if it doesn't exist in the query. I am using a
datagrid to display 4-5 items at a time and if one of the items doesn't
have a revision listed in tblRevisions then the whole page errors out.
I am using the following to try and fix the problem:
Dim intADCN As Integer =
IIf(ds1.Tables("DataTable").Rows(0)("RevNumber") Is Nothing, 0,
ds.Tables("DataTable").Rows(0)("RevNumber"))
I am getting an error: Cast from type 'DBNull' to type 'Integer' is not
valid. It seems as though instead of creating the instance and value of
0, it is simply creating the instance of there being an a row there and
the value is null.
Am I missing something or does anyone have any suggestions?
value of a field if it doesn't exist in the query. I am using a
datagrid to display 4-5 items at a time and if one of the items doesn't
have a revision listed in tblRevisions then the whole page errors out.
I am using the following to try and fix the problem:
Dim intADCN As Integer =
IIf(ds1.Tables("DataTable").Rows(0)("RevNumber") Is Nothing, 0,
ds.Tables("DataTable").Rows(0)("RevNumber"))
I am getting an error: Cast from type 'DBNull' to type 'Integer' is not
valid. It seems as though instead of creating the instance and value of
0, it is simply creating the instance of there being an a row there and
the value is null.
Am I missing something or does anyone have any suggestions?