0
    Dim custEmail As String
    Dim inputEmail As String

    custEmail = dt.Rows(0).Item("email")
    inputEmail = email_add.Text

    if (custEmail.toString() == inputEmail.toString() ){
        label1.Text = custEmail

    }
    End If

This code is giving an error: Compiler Error Message: BC30201: Expression expected.

I just basically want to check if two values are equal but its saying something about expression expected although i've given the expression to evaluate.

2 Answers 2

3

The above is a mix of vb.net and c# syntax. You can use either in .net with success but not both at the same time. Get rid of the { and } to stick with vb.

Sign up to request clarification or add additional context in comments.

5 Comments

and add 'Then'... and make double equals single
@Tahbaza - as Farax is a new member, accurate instructions on rewarding the answer would be good. There is no checkmark and closing questions on SO is the opposite of showing appreciation. @Farax - since Tahbaza's answer helped you out and proved to be the most correct answer, you can upvote (with the Up arrow above the number) as well as accept as the correct answer by ticking the tick below the number.
@Michael - "checkmark" == "tick mark" in my parlance, apologies for upsetting your sensibilities. My comment has now been deleted to avoid any confusion as you are indeed correct that "closing" != accepting.
@Tahbaza - no problems. Sorry if it came across harsh, wasn't meaning to offend :)
Np, I should be more careful in my word choices / happy coding
0

Looks like you are mixing C# and VB.Net. Assuming you are using VB.Net Replace the '{' with Begin IF and remove the '}'.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.