1
Reply

how to compare two string ?

Nirmal KumarC

Nirmal KumarC

Sep 26 2014 10:33 AM
625

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)