B
Bill Gower
I have code as follows
if((DataTable)read_union_database("retrieveSSN")).row[0][0] == DBNull.Value
{
orow[0] = ""
}
else{
orow[0] = ((Data
Table)read_union_database("retrieveSSN")).rows[0][0].ToString();
}
I keep getting the error "There is no row at position 0" and when I place
debug statements in the code it never goes to the If side of the statement.
The read_union_database is just a SQL query
that returns back the SSN of a member that matches a certain parameter. So
in this case obviously I don't have a match and therefore I don't have a row
being returned. What is the proper way in C# to check to see if that
returned?
Bill
if((DataTable)read_union_database("retrieveSSN")).row[0][0] == DBNull.Value
{
orow[0] = ""
}
else{
orow[0] = ((Data
Table)read_union_database("retrieveSSN")).rows[0][0].ToString();
}
I keep getting the error "There is no row at position 0" and when I place
debug statements in the code it never goes to the If side of the statement.
The read_union_database is just a SQL query
that returns back the SSN of a member that matches a certain parameter. So
in this case obviously I don't have a match and therefore I don't have a row
being returned. What is the proper way in C# to check to see if that
returned?
Bill