Hi,

In my code I'm getting a weird error. It's caused by this piece of code:

response = SQLCommand.ExecuteNonQuery();

The error: There is missing a ; at the end of the SQL-instruction.
My eyes may be bad, but I clearly see a ; at the end of this piece of code.

Any solutions??

Check the command text/query pass into the SqlCommand , which is what it is complaining about, but error doesn't show until you execute the command with ExecuteNonQuery :

//
        // Summary:
        //     Initializes a new instance of the System.Data.SqlClient.SqlCommand class
        //     with the text of the query and a System.Data.SqlClient.SqlConnection.
        //
        // Parameters:
        //   cmdText:
        //     The text of the query.
        //
        //   connection:
        //     A System.Data.SqlClient.SqlConnection that represents the connection to an
        //     instance of SQL Server.
        public SqlCommand(string cmdText, SqlConnection connection);
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.