{
if (txtWeight.Text < 1)
{
label6.Text = ("please enter valid weight");
}
{
if (string.IsNullOrEmpty(txtMake.Text.Trim()) || string.IsNullOrEmpty(txtModel.Text.Trim()) || string.IsNullOrEmpty(txtColour.Text.Trim()) || string.IsNullOrEmpty(txtReg.Text.Trim()) || string.IsNullOrEmpty(txtWeight. Text.Trim()))
{
MessageBox.Show("All values are required");
return;
}
}
}
I get an error message here saying "Operator '<' cannot be applied to operands of type 'string' and 'int' Might be because I have x2 IF statements....?
Can someone rewrite this so it displays an error message if the weight is <1 AND an error message if the textboxs are blank?
Thanks if you can.
This post has been edited by modi123_1: 18 November 2010 - 03:53 PM
Reason for edit:: fixed code tag

New Topic/Question
Reply




MultiQuote






|