I have a function that returns a single data row from a data table based on a certain value in a certain column. what if the value doesnt produce a row, how can i determine that by using the empty row?
ie, if i had a query that returned a table that had 0 rows, I could say
if(table.rows.count == 0)
{
do stuff
}
but i cannot do
if(row.columns.count)
{
do stuff
}
ive tried dbnull and row.haserrors but thats not what i am looking for. i want to test the row because i need to use it if it does have values
I pass a datatable to the function. then loop through to find a specific value on a specific field. if i find it, i assign that row and return it. otherwise it just returns a row
so I got Dim myRow as DataRow
Loop if value found, MyRow = thisRow Next
return myRow
(sorry it is vb)