0

Hi,

This is a good snippet:

dim strSQL as String = "INSERT INTO tbl_civil_works(orgcode, item_works, descr, qty_area, " & _ 
"units, rates, amount, timestamp_now) VALUES(" & intOrgCode & _
", '" & param(0) & "', '" & param(1) & "', '" & param(2) & "', '" & param(3) & _
"', " & intAmt & ", '" & DateNTime "')"

I fail to understand why it produces the "End of statement expected" error. What am I missing?

The following is the detailed error message:

i:\inetpub\wwwroot\ecsite\civilTEMP.aspx(69) : error BC30205: End of statement expected.

                               "', " & intAmt & ", '" & DateNTime "')"
3
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by aspproject
0

Not only that I get one more weird "End of statement expected" error:

i:\inetpub\wwwroot\ecsite\civilTEMP.aspx(139) : error BC30205: End of statement expected.

        dim objCmd1 as new OldeDBCommand = ("SELECT * FROM tbl_civil_works", Conn)
0

Hi,

To analyze the problem, It would be better if you post the method/complete code snippet where this error occurs. Because this error could be occurred due to issue in the other lines of code. Please provide the VS and asp.net project version details.

Also refer following links.
http://msdn.microsoft.com/en-us/library/8dy0ah20%28v=vs.80%29.aspx
http://stackoverflow.com/questions/3764476/vb-net-linq-to-datatable-error-end-of-statement-expected
http://www.dreamincode.net/forums/topic/195427-end-of-statement-error/

0

Hi,

To analyze the problem, It would be better if you post the method/complete code snippet where this error occurs. Because this error could be occurred due to issue in the other lines of code. Please provide the VS and asp.net project version details.

Also refer following links.
http://msdn.microsoft.com/en-us/library/8dy0ah20%28v=vs.80%29.aspx
http://stackoverflow.com/questions/3764476/vb-net-linq-to-datatable-error-end-of-statement-expected
http://www.dreamincode.net/forums/topic/195427-end-of-statement-error/

Thanks, I found the solution. I was missing an & after DateNTime, and as for the second error I fragmented the statement using Connection and CommandText of OldeDBCommand.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.