1
Reply

How to validate null Value?

Ask a question
My Source code is


SQl = "select ActiveRate from co_batchwiserate where batchid ='" + CrsList.GetBatchID.ToString().Trim() + "'  and delstate <> 1";

 SqlCommand cmd = new SqlCommand(SQl, SCon.GetConn());

strValue = (string)cmd.ExecuteScalar();

 validate

Stvalue is null or empty means validate this strvalue

if (strValue == null)

        {

            LblErr.Text = "Invalid Course Amount";

            return;

        }


Answers (1)