Nirmal KumarC

Nirmal KumarC

  • 1.4k
  • 327
  • 78.6k

how to compare two string ?

Sep 26 2014 10:33 AM

My Source Code:

string discontamt = txtdiscount.Text; 

example discontamt  amount is:5000

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();

example strvalue amount is:25000

If you only want to compare the string, then I suggest you use something like

if(strValue > discontamt )

{

lblerr.tex="invalid amount";

}

thanks


Answers (1)