Solved

Incorrect syntax near ')'. Error

Posted on 2008-06-18
2
307 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now