.NETGURU
Incorrect syntax near ')'. I cannot find a missing ')' what could cause this
Messages   Related Types
This message was discovered on ASPFriends.com 'ngfx-sqlclient' list.


Dennis West
Below is my code and Stored procedure

Line 1: Incorrect syntax near ')'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near ')'.

Source Error:

Line 382:
Line 383: myCommandI1.Connection.Open()
Line 384: myCommandI1.ExecuteNonQuery()
Line 385: myCommandI1.Connection.Close()
Line 386:

Source File: E:\PortalVBVS\PortalVBVS\admin\ModuleSettings.aspx.vb Line: 384

Stack Trace:

[SqlException: Line 1: Incorrect syntax near ')'.]
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
System.Data.SqlClient.SqlCommand.ExecuteNonQuery()

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess) +0
System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean verifyAccess) +434
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +23
System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +14
Microsoft.VisualBasic.CompilerServices.LateBinding.FastCall(Object o, MethodBase method, ParameterInfo[] Parameters, Object[] args)
Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn)
Microsoft.VisualBasic.CompilerServices.LateBinding.LateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack)
ASPNetPortal.ModuleSettingsPage.BindData() in E:\PortalVBVS\PortalVBVS\admin\ModuleSettings.aspx.vb:384
ASPNetPortal.ModuleSettingsPage.Page_Load(Object sender, EventArgs e) in E:\PortalVBVS\PortalVBVS\admin\ModuleSettings.aspx.vb:67
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()

Dim insertCmdI1 = "insert into AliasFieldNames(ItemID, ModuleID, AliasName)"Dim myCommandI1 = New SqlCommand(insertCmdI1, myConnection)myCommandI1.Parameters.Add(New SqlParameter("@ItemID", SqlDbType.Int))myCommandI1.Parameters("@ItemID").Value = 1myCommandI1.Parameters.Add(New SqlParameter("@ModuleID", SqlDbType.Int))myCommandI1.Parameters("@ModuleId").Value = moduleIdmyCommandI1.Parameters.Add(New SqlParameter("@AliasName", SqlDbType.NVarChar, 50))myCommandI1.Parameters("@AliasName").Value = "Title"myCommandI1.Connection.Open()myCommandI1.ExecuteNonQuery()myCommandI1.Connection.Close()

CREATE PROCEDURE GetModuleType(@ModuleID AS integer)
AS
SELECT * FROM Modules, ModuleDefinitions
WHERE Modules.ModuleID = @ModuleID AND Modules.ModuleDefID = ModuleDefinitions.ModuleDefID AND ModuleDefinitions.FriendlyName = 'Documents'GO

For 2002 ASP.NET Solutions & Articles goto:
http://aspalliance.com/dotnetsolutions/

Dennis West
West Design
MS .NET Developer
www. westontheweb.net
Click here to reveal e-mail address
Reply to this message...
 
    
James Avery
Try

CREATE PROCEDURE GetModuleType

@ModuleID int
AS
SELECT *

FROM Modules, ModuleDefinitions
WHERE Modules.ModuleID = @ModuleID AND
Modules.ModuleDefID = ModuleDefinitions.ModuleDefID AND
ModuleDefinitions.FriendlyName = 'Documents'
GO

-----Original Message-----
From: Dennis West [mailto:Click here to reveal e-mail address]
Sent: Friday, July 12, 2002 11:08 PM
To: ngfx-sqlclient
Subject: [ngfx-sqlclient] Incorrect syntax near ')'. I cannot find a
missing ')' what could cause this

Below is my code and Stored procedure

Line 1: Incorrect syntax near ')'.

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Line 1: Incorrect
syntax near ')'.

Source Error:

Line 382:

Line 383: myCommandI1.Connection.Open()

Line 384: myCommandI1.ExecuteNonQuery()

Line 385: myCommandI1.Connection.Close()

Line 386:

Source File: E:\PortalVBVS\PortalVBVS\admin\ModuleSettings.aspx.vb
Line: 384

Stack Trace:

[SqlException: Line 1: Incorrect syntax near ')'.]

System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream)

System.Data.SqlClient.SqlCommand.ExecuteNonQuery()

[TargetInvocationException: Exception has been thrown by the target of
an invocation.]

System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess)
+0

System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture, Boolean verifyAccess) +434

System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +23

System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
+14

Microsoft.VisualBasic.CompilerServices.LateBinding.FastCall(Object o,
MethodBase method, ParameterInfo[] Parameters, Object[] args)

Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Obje
ct o, Type objType, String name, Object[] args, String[] paramnames,
Boolean[] CopyBack, Boolean IgnoreReturn)

Microsoft.VisualBasic.CompilerServices.LateBinding.LateCall(Object o,
Type objType, String name, Object[] args, String[] paramnames, Boolean[]
CopyBack)

ASPNetPortal.ModuleSettingsPage.BindData() in
E:\PortalVBVS\PortalVBVS\admin\ModuleSettings.aspx.vb:384

ASPNetPortal.ModuleSettingsPage.Page_Load(Object sender, EventArgs e)
in E:\PortalVBVS\PortalVBVS\admin\ModuleSettings.aspx.vb:67

System.Web.UI.Control.OnLoad(EventArgs e)

System.Web.UI.Control.LoadRecursive()

System.Web.UI.Page.ProcessRequestMain()

Dim insertCmdI1 = "insert into AliasFieldNames(ItemID, ModuleID,
AliasName)"

Dim myCommandI1 = New SqlCommand(insertCmdI1, myConnection)

myCommandI1.Parameters.Add(New SqlParameter("@ItemID", SqlDbType.Int))

myCommandI1.Parameters("@ItemID").Value = 1

myCommandI1.Parameters.Add(New SqlParameter("@ModuleID", SqlDbType.Int))

myCommandI1.Parameters("@ModuleId").Value = moduleId

myCommandI1.Parameters.Add(New SqlParameter("@AliasName",
SqlDbType.NVarChar, 50))

myCommandI1.Parameters("@AliasName").Value = "Title"

myCommandI1.Connection.Open()

myCommandI1.ExecuteNonQuery()

myCommandI1.Connection.Close()

CREATE PROCEDURE GetModuleType
(
@ModuleID AS integer
)
AS
SELECT *

FROM Modules, ModuleDefinitions
WHERE Modules.ModuleID = @ModuleID AND
Modules.ModuleDefID = ModuleDefinitions.ModuleDefID AND
ModuleDefinitions.FriendlyName = 'Documents'
GO

For 2002 ASP.NET Solutions & Articles goto:
http://aspalliance.com/dotnetsolutions/

Dennis West
West Design
MS .NET Developer
www. westontheweb.net
Click here to reveal e-mail address

| [ngfx-sqlclient] member Click here to reveal e-mail address = YOUR ID |
http://www.aspfriends.com/aspfriends/ngfx-sqlclient.asp = JOIN/QUIT
Reply to this message...
 
    
Minh Truong
Your command is not calling your SPROC, instead, it's executing a custom
T-SQL command:

"insert into AliasFieldNames..."

----- Original Message -----
From: "Dennis West" <Click here to reveal e-mail address>
To: "ngfx-sqlclient" <Click here to reveal e-mail address>
Sent: Friday, July 12, 2002 11:07 PM
Subject: [ngfx-sqlclient] Incorrect syntax near ')'. I cannot find a missing
')' what could cause this

Below is my code and Stored procedure

Line 1: Incorrect syntax near ')'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Line 1: Incorrect
syntax near ')'.

...

Reply to this message...
 
    
Iain Smallwood
I am slightly confused by the message but would have thought you would
want to syntax like:

"insert into AliasFieldNames(ItemID, ModuleID, AliasName) VALUES
(@ItemID, @ModuleID, @AliasName)"

to make your insert work. I am confused about the inference that your sp
is not working when your scripted insert seems to be giving the problem.

    -----Original Message-----
    From: Dennis West [mailto:Click here to reveal e-mail address]
    Sent: 13 July 2002 04:08
    To: ngfx-sqlclient
    Subject: [ngfx-sqlclient] Incorrect syntax near ')'. I cannot
find a missing ')' what could cause this
    
    
    Below is my code and Stored procedure
    
    

    Line 1: Incorrect syntax near ')'.

    Description: An unhandled exception occurred during the
execution of the current web request. Please review the stack trace for
more information about the error and where it originated in the code.
    
    Exception Details: System.Data.SqlClient.SqlException: Line 1:
Incorrect syntax near ')'.
    
    Source Error:
    
    
Line 382:
Line 383: myCommandI1.Connection.Open()
Line 384: myCommandI1.ExecuteNonQuery()
Line 385: myCommandI1.Connection.Close()
Line 386:

    Source File:
E:\PortalVBVS\PortalVBVS\admin\ModuleSettings.aspx.vb Line: 384
    
    Stack Trace:
    
    
[SqlException: Line 1: Incorrect syntax near ')'.]
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
System.Data.SqlClient.SqlCommand.ExecuteNonQuery()

[TargetInvocationException: Exception has been thrown by the target of
an invocation.]
System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess)
+0
System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture, Boolean verifyAccess) +434
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +23
System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
+14
Microsoft.VisualBasic.CompilerServices.LateBinding.FastCall(Object o,
MethodBase method, ParameterInfo[] Parameters, Object[] args)

Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Obje
ct o, Type objType, String name, Object[] args, String[] paramnames,
Boolean[] CopyBack, Boolean IgnoreReturn)
Microsoft.VisualBasic.CompilerServices.LateBinding.LateCall(Object o,
Type objType, String name, Object[] args, String[] paramnames, Boolean[]
CopyBack)
ASPNetPortal.ModuleSettingsPage.BindData() in
E:\PortalVBVS\PortalVBVS\admin\ModuleSettings.aspx.vb:384
ASPNetPortal.ModuleSettingsPage.Page_Load(Object sender, EventArgs e)
in E:\PortalVBVS\PortalVBVS\admin\ModuleSettings.aspx.vb:67
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()

Dim insertCmdI1 = "insert into AliasFieldNames(ItemID, ModuleID,
AliasName)"

Dim myCommandI1 = New SqlCommand(insertCmdI1, myConnection)

myCommandI1.Parameters.Add(New SqlParameter("@ItemID", SqlDbType.Int))

myCommandI1.Parameters("@ItemID").Value = 1

myCommandI1.Parameters.Add(New SqlParameter("@ModuleID", SqlDbType.Int))

myCommandI1.Parameters("@ModuleId").Value = moduleId

myCommandI1.Parameters.Add(New SqlParameter("@AliasName",
SqlDbType.NVarChar, 50))

myCommandI1.Parameters("@AliasName").Value = "Title"

myCommandI1.Connection.Open()

myCommandI1.ExecuteNonQuery()

myCommandI1.Connection.Close()

CREATE PROCEDURE GetModuleType
(
@ModuleID AS integer
)
AS
SELECT *

FROM Modules, ModuleDefinitions
WHERE Modules.ModuleID = @ModuleID AND
Modules.ModuleDefID = ModuleDefinitions.ModuleDefID AND
ModuleDefinitions.FriendlyName = 'Documents'
GO
    
    For 2002 ASP.NET Solutions & Articles goto:
    http://aspalliance.com/dotnetsolutions/

    Dennis West
    West Design
    MS .NET Developer
    www. westontheweb.net
    Click here to reveal e-mail address
    
    
    | [ngfx-sqlclient] member Click here to reveal e-mail address = YOUR ID |
http://www.aspfriends.com/aspfriends/ngfx-sqlclient.asp = JOIN/QUIT

Disclaimer
This message may contain information which is legally privileged and/or
confidential. If you are not the intended recipient, you are hereby
notified that any unauthorised disclosure, copying, distribution or use
of this information is strictly prohibited. Such notification not
withstanding, any comments or opinions expressed are those of the
originator, not of Taylor Made Computer Solutions, unless otherwise
explicitly stated.
Reply to this message...
 
    
Dennis West
MessageI am sorry I found the problem shortly after posting it ( I left half of the insert off when i copied it into my code) I gues i just didn't expect to see the ')' which was the right symptom for the error.
----- Original Message -----
From: Iain Smallwood
To: ngfx-sqlclient
Sent: Monday, July 15, 2002 3:07 AM
Subject: [ngfx-sqlclient] RE: Incorrect syntax near ')'. I cannot find a missing ')' what could cause this

I am slightly confused by the message but would have thought you would want to syntax like:

"insert into AliasFieldNames(ItemID, ModuleID, AliasName) VALUES (@ItemID, @ModuleID, @AliasName)"

to make your insert work. I am confused about the inference that your sp is not working when your scripted insert seems to be giving the problem.
-----Original Message-----
From: Dennis West [mailto:Click here to reveal e-mail address]
Sent: 13 July 2002 04:08
To: ngfx-sqlclient
Subject: [ngfx-sqlclient] Incorrect syntax near ')'. I cannot find a missing ')' what could cause this

Below is my code and Stored procedure

Line 1: Incorrect syntax near ')'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near ')'.

Source Error:

Line 382:
Line 383: myCommandI1.Connection.Open()
Line 384: myCommandI1.ExecuteNonQuery()
Line 385: myCommandI1.Connection.Close()
Line 386:

Source File: E:\PortalVBVS\PortalVBVS\admin\ModuleSettings.aspx.vb Line: 384

Stack Trace:

[SqlException: Line 1: Incorrect syntax near ')'.]
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
System.Data.SqlClient.SqlCommand.ExecuteNonQuery()

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess) +0
System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean verifyAccess) +434
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +23
System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +14
Microsoft.VisualBasic.CompilerServices.LateBinding.FastCall(Object o, MethodBase method, ParameterInfo[] Parameters, Object[] args)
Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn)
Microsoft.VisualBasic.CompilerServices.LateBinding.LateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack)
ASPNetPortal.ModuleSettingsPage.BindData() in E:\PortalVBVS\PortalVBVS\admin\ModuleSettings.aspx.vb:384
ASPNetPortal.ModuleSettingsPage.Page_Load(Object sender, EventArgs e) in E:\PortalVBVS\PortalVBVS\admin\ModuleSettings.aspx.vb:67
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()

Dim insertCmdI1 = "insert into AliasFieldNames(ItemID, ModuleID, AliasName)"Dim myCommandI1 = New SqlCommand(insertCmdI1, myConnection) myCommandI1.Parameters.Add(New SqlParameter("@ItemID", SqlDbType.Int))myCommandI1.Parameters("@ItemID").Value = 1myCommandI1.Parameters.Add(New SqlParameter("@ModuleID", SqlDbType.Int))myCommandI1.Parameters("@ModuleId").Value = moduleIdmyCommandI1.Parameters.Add(New SqlParameter("@AliasName", SqlDbType.NVarChar, 50))myCommandI1.Parameters("@AliasName").Value = "Title" myCommandI1.Connection.Open()myCommandI1.ExecuteNonQuery()myCommandI1.Connection.Close()

CREATE PROCEDURE GetModuleType(@ModuleID AS integer)
AS
SELECT * FROM Modules, ModuleDefinitions
WHERE Modules.ModuleID = @ModuleID AND Modules.ModuleDefID = ModuleDefinitions.ModuleDefID AND ModuleDefinitions.FriendlyName = 'Documents'GO

For 2002 ASP.NET Solutions & Articles goto:
http://aspalliance.com/dotnetsolutions/

Dennis West
West Design
MS .NET Developer
www. westontheweb.net
Click here to reveal e-mail address

| [ngfx-sqlclient] member Click here to reveal e-mail address = YOUR ID | http://www.aspfriends.com/aspfriends/ngfx-sqlclient.asp = JOIN/QUIT
Disclaimer
This message may contain information which is legally privileged and/or confidential. If you are not the intended recipient, you are hereby notified that any unauthorised disclosure, copying, distribution or use of this information is strictly prohibited. Such notification not withstanding, any comments or opinions expressed are those of the originator, not of Taylor Made Computer Solutions, unless otherwise explicitly stated.
| [ngfx-sqlclient] member Click here to reveal e-mail address = YOUR ID | http://www.aspfriends.com/aspfriends/ngfx-sqlclient.asp = JOIN/QUIT
Reply to this message...
 
 
Microsoft.VisualBasic.CompilerServices.LateBinding
System.Data.CommandBehavior
System.Data.SqlClient.SqlCommand
System.Data.SqlClient.SqlException
System.Data.SqlClient.SqlParameter
System.Data.SqlDbType
System.EventArgs
System.Globalization.CultureInfo
System.Reflection.BindingFlags
System.Reflection.MethodBase
System.Reflection.ParameterInfo
System.Reflection.TargetInvocationException
System.Web.UI.Control
System.Web.UI.Page




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification