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.ExecuteScalar();
if (result == null)
return "Customer not found";
if (result == System.DBNull.Value)
return "Customer found but name is null";
return (string) result;
///
Okay, I am not thinking straight this morning and understand now. Thanks.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.