unable to delete from SQLCE 2005

  • I am trying to delete record form SQL CE 2005 in my program, I am writing the following statement

    sSQL = "Delete * from detail where order_no = '" & OrderNumber & "' and Item_no = '" & sDSItemNo & "'"

    cmd.CommandText = sSQL

    cmd.ExecuteNonQuery()

    and I get the folllowing error:

    There was an error parsing the query. [ Token line number = 1,Token line offset = 8,Token in error = * ]

    Then I ran the query from within the SQL Server Mgmt Studio

    Delete * from detail where order_no = '0104524' and item_no = 'BT REPL 2%'

    and got the same error as follows

    Major Error 0x80040E14, Minor Error 25501

    > Delete * from detail where order_no = '0104524' and item_no = 'BT REPL 2%'

    There was an error parsing the query. [ Token line number = 1,Token line offset = 8,Token in error = * ]

  • Try This

    sSQL = "Delete detail where order_no = '" & OrderNumber & "' and Item_no = '" & sDSItemNo & "'"

    cmd.CommandText = sSQL

    Thanks,

    Neal

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply