Wrox Programmer Forums
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 6th, 2010, 10:02 AM
Authorized User
 
Join Date: Mar 2010
Posts: 27
Thanks: 2
Thanked 1 Time in 1 Post
Default Update Error

When I click button Update this error is cccurred :

Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near 'nvarchar'.

my SqlDataSource is:
Code:
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:AdNetConnectionString %>" 
            SelectCommand="SELECT AdCampaign.CampaignName, AdCampaign.AdType AS [Campaign Type], AdCampaign.Date AS [Start Date], AdCampaign.Clicks, AdCampaign.Impr, AdCampaign.DailyBudget AS [Daily budget] , AdCampaign.Status FROM Account INNER JOIN AdCampaign ON Account.ID = AdCampaign.AccountID WHERE (Account.EmailAddress = @EmailAddress)" 
            UpdateCommand="UPDATE AdCampaign SET DailyBudget = 30 FROM Account INNER JOIN AdCampaign ON Account.ID = AdCampaign.AccountID WHERE (Account.EmailAddress = @EmailAddress)">
            <SelectParameters>
                <asp:SessionParameter Name="EmailAddress" SessionField="EmailAddress" />
            </SelectParameters>
            <UpdateParameters>
                <asp:Parameter Name="EmailAddress"   />
            </UpdateParameters>
            </asp:SqlDataSource>
the parameter :
Code:
<asp:Parameter Name="EmailAddress"   />
is a session parameter.


I am waiting please guide me.
 
Old May 6th, 2010, 10:53 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

You are in the wrong forum.. you problem is with asp.net, not SQL..

Anyway, I don't see anywhere a problem. Could be in other place? Does that query alone work by itself???
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
Update Query Error Tim Johnson Access 2 December 6th, 2007 02:57 PM
Update Statement some error thas123 ADO.NET 1 January 8th, 2006 10:30 AM
update query error khautinh SQL Server 2000 2 July 1st, 2004 09:30 PM
Error after a update EdwardA Classic ASP Professional 2 February 27th, 2004 03:31 AM
update records error damnnono_86 Access 1 January 28th, 2004 03:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.