Here is my SQL statement:
UPDATE InboxItem
SET OrderId = @0, Item = @1, Quantity = @2, Price = @3,
Memo = "", InboxId = @4, VATId = @5
WHERE Id = @6
This throws SqlException, saying that
An object or column name is missing or empty. For SELECT INTO
statements, verify each column has a name. For other statements, look
for empty alias names. Aliases defined as \”\” or [] are not allowed.
Change the alias to a valid name.
I think I know what the problem is. If I give value to Memo, everything is ok. However, I sometimes want memo to be empty string. How to do this?
Use
''instead of"". Also verify that your input is escaped properly (perhaps one of the strings has a comma in it that is unescaped).