Asp to Asp.net

  • Thread starter Thread starter amitbadgi
  • Start date Start date
A

amitbadgi

Hi I am new to this group. I am currently converting an asp application
to asp.net, I am getting this error and unable to fix it,

Compiler Error Message: BC30203: Identifier expected.

Source Error:


Line 297:
Line 298:
Line 299:sql =" SELECT TOP 25 tblEvent.case_no, tblEvent.entered_by AS
Expr1, tblEvent.offender_id, tblEvent.stu_id, tblEvent.date_of_event,
tblEvent.offendertype, " &_
Line 300:"tblLKP_Location.Location, tblLKP_Offender_type.Offender_type
" &_
Line 301:" FROM tblEvent INNER JOIN " &_


I am bit confused, if some one could help me out it would be
great.thanx
 
Hi I am new to this group. I am currently converting an asp application
to asp.net, I am getting this error and unable to fix it,

Compiler Error Message: BC30203: Identifier expected.

Source Error:


Line 297:
Line 298:
Line 299:sql =" SELECT TOP 25 tblEvent.case_no, tblEvent.entered_by AS
Expr1, tblEvent.offender_id, tblEvent.stu_id, tblEvent.date_of_event,
tblEvent.offendertype, " &_
Line 300:"tblLKP_Location.Location, tblLKP_Offender_type.Offender_type
" &_
Line 301:" FROM tblEvent INNER JOIN " &_


I am bit confused, if some one could help me out it would be
great.thanx

It looks like you're not declaring the variable sql. In ASP.Net using VB.Net
Option Eplicit is the default. You can try the following to see if it will
take care of the problem:
Dim sql As String = "...
 
I assume you are declaring sql, ala:

Dim sql As String

somewhere? If not, you will get another error a bit later, as Option
Explicit is on, by default, in VB.NET. This is not what is causing your
error, however. The problem is no space between ampersand and underscore. The
corrected statement:

Dim sql As String = "SELECT TOP 25 tblEvent.case_no," & _
" tblEvent.entered_by AS Expr1, tblEvent.offender_id," & _
" tblEvent.stu_id, tblEvent.date_of_event, tblEvent.offendertype," & _
" tblLKP_Location.Location, tblLKP_Offender_type.Offender_type"

You should get the idea.

Short answer: change &_ to & _ (space in middle)

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
See reply to CodeMeister for full details.

The current issue is &_ should have a space in between: & _

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
Back
Top