Click here to Skip to main content
15,887,477 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi

I am using vb.net windows application this my code i got the following error
VB
  Dim i As Integer
  tTLeaveAvailable.Text = i

 If i = 0 Then

 tTLeaveAvailable.Text = Val(txtcasualleave.Text)-Val(txtleavegiving.Text)

 Else
    if (i !=0)  //Identifire Expected


tTLeaveAvailable.Text = Val(txtTleavetaken.Text) + Val(txtleavegiving.Text) - Val(txtcasualleave.Text)
     End If


 End If


How to slove this error
Posted

1 solution

The VB.NET inequality operator is '<>', not '!='.

It is worthy note that, in any case, testing for the i<>0 there is pointless (if the control reached the 'Else' clause then i must be inequal to zero).
 
Share this answer
 
Comments
Uday P.Singh 21-Mar-12 6:15am    
5!
Member 8614787 21-Mar-12 6:25am    
Thanks for your reply i am correct my error it's working now

Thanks,
Sergey Alexandrovich Kryukov 21-Mar-12 20:08pm    
Ha-ha, a 5.

There was a real story on the Web.

A student programmed:

v = 5;
v = 5;

-- 'Why the second assignment?'
-- 'In case it wasn't right in first line...'

--SA
CPallini 22-Mar-12 4:29am    
In my former company (real work life!):
If a=0 Then
..
Else If a<>0 And a=1 Then
..
Sergey Alexandrovich Kryukov 22-Mar-12 16:02pm    
:-)
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900