Hi guys a got a question for you.
I am reading in from an oracle table into a form and in order to see when there is no more records i do:
if (a["CUS_ID"]==""
{
lstBoxSearchResults.Items.Add("No results found"
} else {
whatver........
now CUS_ID is my primary key in my table so every record has it. a is my DataReader. i do this in a loop and it will read and write to the form and read and write to the form but when the last record is read into 'a', it goes to that if statement and an exception happens. i tried doing this also:
if ((a["CUS_ID"]==null) || (a["CUS_ID"]=="")
and it still throws that "no data in row/column" exception. how can i catch this in an if statement. i mean i can put this in an try catch block but that takes up cpu time.
any ideas??
thank you
mike
I am reading in from an oracle table into a form and in order to see when there is no more records i do:
if (a["CUS_ID"]==""
{
lstBoxSearchResults.Items.Add("No results found"
} else {
whatver........
now CUS_ID is my primary key in my table so every record has it. a is my DataReader. i do this in a loop and it will read and write to the form and read and write to the form but when the last record is read into 'a', it goes to that if statement and an exception happens. i tried doing this also:
if ((a["CUS_ID"]==null) || (a["CUS_ID"]=="")
and it still throws that "no data in row/column" exception. how can i catch this in an if statement. i mean i can put this in an try catch block but that takes up cpu time.
any ideas??
thank you
mike