Farax
Farax

Reputation: 31

Problems with If Statement (ASP.NET)

    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.

Upvotes: 0

Views: 451

Answers (2)

Richard Schneider
Richard Schneider

Reputation: 35464

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

Upvotes: 0

Tahbaza
Tahbaza

Reputation: 9546

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.

Upvotes: 3

Related Questions