DotNetGnat
Programmer
Hi guys...
i am doing something like this...(below is a dummy code)
int val;
sql = "Select field1 from mytable where Id = 2 ";
---
---
val = (int)dbCmd.ExecuteScalar();
works fine and i get the val if the record exists...but what if the record doesnt exist...i mean how to check for the zero rows using ExecuteScalar??
am i missing something simple here...
-DNG
i am doing something like this...(below is a dummy code)
int val;
sql = "Select field1 from mytable where Id = 2 ";
---
---
val = (int)dbCmd.ExecuteScalar();
works fine and i get the val if the record exists...but what if the record doesnt exist...i mean how to check for the zero rows using ExecuteScalar??
am i missing something simple here...
-DNG