Welcome to Dream.In.Code
Getting Help is Easy!

Join 118,659 Programmers for FREE! Ask your question and get quick answers from experts. There are 868 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Syntax Error in NonQuery Command

 
Reply to this topicStart new topic

Syntax Error in NonQuery Command, I can't figure out what's wrong with this command

Redian
post 2 Jul, 2008 - 08:55 PM
Post #1


New D.I.C Head

*
Joined: 28 Dec, 2007
Posts: 21

I'm accessing a database in C#. It keeps telling me there's a syntax error in this command string:
CODE
"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
User is offlineProfile CardPM

Go to the top of the page


Martyr2
post 2 Jul, 2008 - 09:48 PM
Post #2


Programming Theoretician

Group Icon
Joined: 18 Apr, 2007
Posts: 4,649



Thanked 121 times

Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions


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. smile.gif
User is offlineProfile CardPM

Go to the top of the page

PsychoCoder
post 2 Jul, 2008 - 10:49 PM
Post #3


using DIC.Core;

Group Icon
Joined: 26 Jul, 2007
Posts: 7,917



Thanked 83 times

Dream Kudos: 8100

Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, GDI, Boo.Net

My Contributions


What database are you using?
User is online!Profile CardPM

Go to the top of the page

Redian
post 3 Jul, 2008 - 01:42 PM
Post #4


New D.I.C Head

*
Joined: 28 Dec, 2007
Posts: 21

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: 3 Jul, 2008 - 06:15 PM
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 10/12/08 04:01AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month