You are getting Nothing (VB) or null(C#) value.
I guess if there is nothing (not even a dbnull field) to return you get null
(DBNull is a returned Null from database)
ExecuteScalar returns the value of the first column of the first row of the
first resultset. if there is no resultset, then there is no value to return,
so it returns null. makes perfect sense.
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.