Udostępnij za pośrednictwem


Method cannot contain both an 'On Error GoTo' statement and a lambda or query expression

A method contains both an On Error Goto statement and either a lambda expression or a LINQ query. You cannot include an On Error Goto statement with a lambda expression or LINQ query in a method.

Error ID: BC36595

To correct this error

  • Replace the exception handling code that uses the On Error Goto statement with a Try...Catch statement.

See Also

Concepts

Introduction to Exception Handling

Introduction to LINQ in Visual Basic

Lambda Expressions

Reference

Try...Catch...Finally Statement (Visual Basic)

On Error Statement (Visual Basic)