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 "')"

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)

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/

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.

Hi,

Glad to hear that you found a solution. Please mark this thread as solved.

try this ...
'" & param(3) "' & _ ,

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.