W
Wal Turner
I am using the System.Data.DataTable class which I have heard may display
some unusual behaviour.
I am doing
DataRow[] dr = dataTable.Select(sql);
The sql in this instance doesnt matter - what is important is that dr.Length
is greater than 0, implying there is at least one result.
However I discovered that sometimes this method was returning dr.Length = 1
when I thought it should return 0 rows. In fact, the dataTable contents
reflected it returning 0 rows but it chose to return one anyway!
Further inspection showed this DataRow to be null, ie dr[0] == null
Has anyone come across this similar problem?
Regards
Wal
some unusual behaviour.
I am doing
DataRow[] dr = dataTable.Select(sql);
The sql in this instance doesnt matter - what is important is that dr.Length
is greater than 0, implying there is at least one result.
However I discovered that sometimes this method was returning dr.Length = 1
when I thought it should return 0 rows. In fact, the dataTable contents
reflected it returning 0 rows but it chose to return one anyway!
Further inspection showed this DataRow to be null, ie dr[0] == null
Has anyone come across this similar problem?
Regards
Wal