I reviewed your code and found that
sqlCmd.ExecuteNonQuery();
is returning -1. Since it does not query database therefore no outcome is created. This method is mainly used to insert values in a database.
I changed the following lines of codes
int nRet = sqlCmd.ExecuteNonQuery();
if (nRet == 0)
with the following line and it is working fine.
if (String.IsNullOrEmpty(sqlCmd.ExecuteScalar().ToString()))
Hope this may answer your question