Trouble with adding a new record

It would be appreciated if, in future, you could attach your images directly to your posts so we don't have to run off to external sites.

As for the question, the most common cause for this issue is that one of your table or column names is a reserved word. When it gets included in the auto-generated SQL code it causes a syntax error because an identifier is expected. You should read the documentation for your database and see what the SQL reserved words are and avoid using them as table or column names. Common culprits are Date and Password.

If you must use a reserved word as a table or column name then instead of using a wildcard in your SELECT statement, e.g.
VB.NET:
SELECT * FROM User
you should write out the entire column list and wrap any reserved words in brackets, e.g.
VB.NET:
SELECT UserName, [Password] FROM User
The brackets should be used in the auto-generated SQL code too and no syntax error should occur.
 
It would be appreciated if, in future, you could attach your images directly to your posts so we don't have to run off to external sites.
I like it actually.. Don't like ImageShack, prefer host.photogalaxy.net but having a thumb here means I dont have to wait a long time for the thread to load if I'm not on broadband


I get a syntax error in the INSERT INTO Statement

Perhaps knowing the section of code where you wrote your INSERT statement (or what you typed into the TableAdapter wizard) would help :rolleyes:
 
I like it actually.. Don't like ImageShack, prefer host.photogalaxy.net but having a thumb here means I dont have to wait a long time for the thread to load if I'm not on broadband
Of course, people don't have to take a shot of their entire 1680x1050 screen when an image 1/4 that size or even less can show everything that's relevant. In fact, there's often no need for an image at all when you can simply paste the code into your post.
 

Latest posts

Back
Top