troubleshooting Question

Incorrect syntax error

Avatar of PatrickSweeney
PatrickSweeney asked on
Microsoft SQL Server
5 Comments1 Solution267 ViewsLast Modified:
I'm getting the following error
Line 1: Incorrect syntax near 'nvarchar'.
Must declare the variable '@ID'.

I ran a trace and the statement is being passed to SQL Server with the parameters, but it is not updating.
Using VB.Net, Asp 2.0, SQL Server 2000.
To me the code seems identical to other forms where it is working fine.

This code:

           UpdateCommand="update [Leads] set  brief_description=@brief_description, value=@value, [status]= @status, decision_date=@decision_date, probability=@probability where id=@id">
            <UpdateParameters>
                <asp:Parameter Name="Customer_Name" Type="String" />
                <asp:Parameter Name="decision_Date" type="datetime"/>
                <asp:Parameter Name="probability" type="string"/>
                <asp:Parameter Name="brief_description" Type="String" />
                <asp:Parameter Name="value" Type="Decimal" />
                <asp:Parameter Name="status" Type="String" />
                <asp:Parameter Name="ID"  />
            </UpdateParameters>
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros