System.Data.SqlClient.SqlException: 'Incorrect syntax near the keyword 'FUNCTION'.'

J L 26 Reputation points
2022-11-20T18:40:56.63+00:00

I followed all the steps in the c# procedure "Create a Windows Forms user control that supports simple data binding" and it worked fine.
Then I did the same, but instead of one Usercontrol I created four, and whenever I click on the Save button (created automatically) I get the message

System.Data.SqlClient.SqlException: 'Incorrect syntax near the keyword 'FUNCTION'.'

I appreciate any help.

262295-image.png

Developer technologies C#
{count} votes

1 answer

Sort by: Most helpful
  1. Viorel 122.5K Reputation points
    2022-11-21T13:02:17.477+00:00

    Try avoiding special names, or use "[ ]" if you write SQL commands manually. For example: select [FUNCTION] from MyTable.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.