Syntax Error in NonQuery Command

I can't figure out what's wrong with this command

Page 1 of 1

3 Replies - 1337 Views - Last Post: 03 July 2008 - 01:42 PM Rate Topic: -----

#1 Redian   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 48
  • Joined: 28-December 07

Syntax Error in NonQuery Command

Post icon  Posted 02 July 2008 - 08:55 PM

I'm accessing a database in C#. It keeps telling me there's a syntax error in this command string:
"CREATE TABLE [InterestedCustomers] (FirstName text, LastName text, Address1 text, Address2 text, City text, State text, ZipCode text, HomeNum text, BusNum text, Position text, EmailAdr text, Subjects text, Projectr text, SchlName text, SchlAdr1 text, SchlAdr2 text, SchlCity text, SchlState text, SchlZip text, SchlNum text, Software text, Subject text, WandTrial text, Comments text)"


Can anyone find what's wrong with it?
Thanks in advance

Is This A Good Question/Topic? 0
  • +

Replies To: Syntax Error in NonQuery Command

#2 Martyr2   User is offline

  • Programming Theoretician
  • member icon

Reputation: 5227
  • View blog
  • Posts: 14,010
  • Joined: 18-April 07

Re: Syntax Error in NonQuery Command

Posted 02 July 2008 - 09:48 PM

The query syntax itself is not a problem. That is assuming you are not trying to create the table when it is already there (did you remember to drop it first?)

So show us the code you are using to execute this query. Thanks. :)
Was This Post Helpful? 0
  • +
  • -

#3 PsychoCoder   User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1659
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Syntax Error in NonQuery Command

Posted 02 July 2008 - 10:49 PM

What database are you using?
Was This Post Helpful? 0
  • +
  • -

#4 Redian   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 48
  • Joined: 28-December 07

Re: Syntax Error in NonQuery Command

Posted 03 July 2008 - 01:42 PM

I found my problem, it was because POSITION is a standard property. Now I just have to find a way to change that columns name in excel back to POSITION

[b]EDIT: Nevermind, I figured it out, placing it in [] allows for spaces.

This post has been edited by Redian: 03 July 2008 - 06:15 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1