Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Incorrect syntax near ')'. Error

Posted on 2008-06-18
2
Medium Priority
?
321 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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses
Course of the Month11 days, 10 hours left to enroll

916 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