it really depends on what you need to find out about the result
if you need to test if a the row/data exists then just check for null and
you need to test if the row/data exists and has a valid value then try the
following
///
object result = cmd.ExecuteScal ar();
if (result == null)
return "Customer not found";
if (result == System.DBNull.V alue)
return "Customer found but name is null";
return (string) result;
///
Okay, I am not thinking straight this morning and understand now. Thanks.
"Misbah Arefin" <MisbahArefin@d iscussions.micr osoft.comwrote in message
news:F1D650E9-18EF-4033-9C4B-4009547F20EB@mi crosoft.com...
it really depends on what you need to find out about the result
if you need to test if a the row/data exists then just check for null and
you need to test if the row/data exists and has a valid value then try the
following
>
///
object result = cmd.ExecuteScal ar();
>
if (result == null)
return "Customer not found";
if (result == System.DBNull.V alue)
return "Customer found but name is null";
return (string) result;
///
>
>
--
Misbah Arefin
Comment