Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Incorrect syntax near ')'. Error

Posted on 2008-06-18
2
313 Views
Last Modified: 2013-11-26
Good Day:

I am using WinForms VB.NET 2005 with SQL Server 2000.  I get an error that reads Incorrect syntax near ')'. for the following code:

sSQL = "INSERT INTO NodeChild_t(ID, Child,UserGroup,) values('" & _
                  Me.cboParent.SelectedValue & "','" & _
                   Me.cboChild.Text & "','" & _
                  Me.cboGroup.Text & "')"

I always get confused when I have to concatenate an sql string.  Any suggestions?

Thank You,
Denise
0
Comment
Question by:DeniseGoodheart
2 Comments
 
LVL 3

Accepted Solution

by:
jagmohan_gunwant earned 500 total points
ID: 21814963
Hello Friend
There is a Problem in Your Insert Statement i,.e. why it is saying like this, The Problem is the extra , in Your insert Statement before The values starts as given you insert statement should be as follows


"INSERT INTO NodeChild_t(ID, Child, UserGroup) values('" & _
                  Me.cboParent.SelectedValue & "','" & _
                   Me.cboChild.Text & "','" & _
                  Me.cboGroup.Text & "')"

Open in new window

0
 

Author Comment

by:DeniseGoodheart
ID: 21814992
Thanks!
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question