vb6rookie Posted May 31, 2011 Posted May 31, 2011 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. Quote
Sombra Dolorosa Posted October 3, 2012 Posted October 3, 2012 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.