If Statement condition c# is not working

No. They have very different syntax. We are talking about C# vs vb.net