Solved

Incorrect syntax near ')'. Error

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

735 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