Nirmal KumarC

Nirmal KumarC

  • 1.4k
  • 327
  • 78.8k

How to validate null Value?

Sep 27 2014 4:31 AM
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)