Anyone please help me, my problem is this
i want to check in c#, more textbox values conditions using ‘if’ statement like this,
if(txtbox1.Text == "" && txtbox2.Text == "" && ...&&txtboxN.Text =="")
{
MessageBox.Show("Please enter the details");
return;
}
but when i use more condition it is not taking the ‘second’ and others conditions..
what is the solution for this?
You have to use &, not &&.
With && if first condition is false, other conditions are not evaluated at all.
Anyway for your example I think you should use
||, so if one of textboxes is empty your message is shown.