Solved

Incorrect syntax near ')'. Error

Posted on 2008-06-18
2
317 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
[X]
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
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 …
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

623 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