compare scopes of the var and let keywords : what is the if checking?
tell us what’s happening:

what is the if checking?

my guess is it doesn’t check anything. the code will run no matter what. on the flip side, if i change it to if(false), the code will not run.

i checked both mdn and w3school. they don’t have example where the condition is just a true or false. t…
if statements always check if an expression evaluates to the value of true. since you’re checking whether the value true  value true then it’ll run every time. as for the “purpose” of the if statement, it’s here to create a “block scope” within the “function scope”.

interestingly, if you remove …
Check if any of the values in the cells are null.  

If they are you need to modify your code to check for null conditions before using `ToString()`. you can use lazy evaluation so if the first expression returns true it will not check the second expression. just change the ‘or’ in your statement to ‘orelse’ so it would be:

“string.isnullorempty(message) orelse message.contains(”!")" hi [@rrenu59](/u/rrenu59)

form my knowledge

isnothing - method used to check if the variable is initalized, nothing means the variable is not intialized (i.e) there is no memory is allocated for this variable

nullorwhitespace - it is to check whether it is empty or contain any whitespace. Your test is redundant, since you are already querying only for matching records. In this case, you will get no rows if there is no match, therefore you will never hit the else clause in the loop.  

  

Instead, it is enough to check if there are any matching records at all. The example below shows how (note that you can put a condition straight into Any() instead of specifying Where()).  

  

C#Copy Code

```
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
namespace CustomerMaster
{
    public partial class CustomerMaster : System.Web.UI.Page
    {
 
        private void AddData()
        {
            
            OperationsDataContext AddDb = new OperationsDataContext();
            CustomerMast cm = new CustomerMast();
            
                        
            cm.CustomerCode = txtCustCde.Text;
            cm.CustomerName = txtCustName.Text;
            cm.CustomerAddress = txtCustAdd.Text;
            cm.BrkrCode = txtBrkCode.Text;
            cm.BrokerName = txtBrkName.Text.
            cm.CrrCode = txtCrrCode.CarrierCode;
            cm.CarrierName =  txtCrrName.Text;
            cm.StnCode=sm.StationCode;
            cm.StationName = txtStnName.Text;
            cm.VatNo=txtVatNo.Text;
            cm.TinNo=txtTinNo.Text;
            cm.TMCO=txtTMCONo.Text;
            cm.PanNo = txtPAN.Text;
			
	    if(AddDb.CustomerMasts.Any(c=>c.CustomerCode == txtCustCde.Text))
            {
	        Response.Write("Error! CustomerCode Exits");
	    }
	    else
	    {
                AddDb.BrokerMasts.InsertOnSubmit(bm);
                AddDb.CarrierMasts.InsertOnSubmit(crm);
                AddDb.StationMasts.InsertOnSubmit(sm);
                AddDb.CustomerMasts.InsertOnSubmit(cm);

	        AddDb.SubmitChanges();
            }         
        }
 
        protected void btnAdd\_Click(object sender, EventArgs e)
        {
            AddData();
        }
    }
}
``` i've been meaning to write a blog post on this for a while, but haven't got round to it yet, so i'll give the condensed version here :slight\_smile:

to understand why the if let syntax is the way it is, we should first look at the let syntax. in most cases, you'll see it used for simple variable dec… you can simply write (i.e. do not expand the variable):

if (my\_var strequal "true")

in this case, a non-existing variable will evaluate to false (boolean value as defined by cmake).

and, in the case of expected value is a true value as defined by cmake:

if (my\_var) Your function works, but both the IF and the ELSE return an alert message that says its invalid.  

The first part - the IF - should return in the alert box "Valid SSN"  

I am assuming your input should be like this 123-45-1234


but do you need to tell the user the input is valid? Surely the alert should only be displayed if the input is invalid? So the if should return nothing. imho for most schools, your application is considered complete once all parts of your application have been sent in; this includes test scores. therefore, unless you specifically request otherwise, it's going to be a toss-up as to whether or not your application gets looked at before your second set of s… ![A Software Test Engineer](https://cpentalk.com/?qa=blob&qa_blobid=12836291948296319823)

Testing is a process, which shows a program does what it is intended to do and it helps to discover program defects before it is put into use. 


> It is not necessary for a program to be completely free of defects before it is delivered to its customers because it is not always (99% of the time) possible to deliver a defect free product to the customer which is of 100% quality.
> 
> 

And testing cannot completely validate that a system is fit for its intended purpose as this requires a detailed knowledge of what that purpose will be and exactly how the system will be used. As these details inevitably change between deciding to procure a system and deploying that system, the testing will be necessarily incomplete.

In addition, it is practically impossible for all except trivial system to have a complete test set that covers all possible ways that the system is likely to be used.

**A program need not be completely free of defects before delivery if:**

1. Remaining defects are minor defects that do not cause system corruption and which are transient i.e. which can be cleared when new data is input.

2. Remaining defects are such that they are recoverable and a recovery function that causes minimum user disruption is available.

3. The benefits to the customer's business from the system exceed the problems that might be caused by the remaining system defects.





Please leave a comment below if you found this answer helpful. Happy learning! can you try with other dropdowns? if its working , nothing wrong with your code and something to do with that specific drop down.