Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have created my C# project and have made a referecnt to that projust using the code listed above.

The database creates but I get an error on the following line:

cmd.Execute(out i, ref arry, 1);

 

ERROR: Syntax error in INSERT INTO statement.

Any thoughts? Your help is very much appreciated.

  • 1 year later...
Posted

You have to put the table name in brackets just like this:

 

result.CommandText = string.Format("INSERT INTO [{0}] ({1}) values({2}) ", aTable.TableName, "{0}", "{1}");

 

instead of:

 

result.CommandText = string.Format("INSERT INTO {0} ({1}) values({2}) ", aTable.TableName, "{0}", "{1}");

 

It worked for me.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...