Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
|
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 3rd, 2010, 06:15 AM
Authorized User
 
Join Date: Mar 2010
Posts: 27
Thanks: 2
Thanked 1 Time in 1 Post
Default Update query Error

I have this SqlDataSource:
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>
But when I click Button Update this error occurred:

Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near 'nvarchar'.
 
Old May 3rd, 2010, 07:22 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Try using following update command

UpdateCommand
="UPDATE AdCampaign SET DailyBudget = 30 FROM AdCampaign INNER JOIN AccountON Account.ID = AdCampaign.AccountID WHERE (Account.EmailAddress = @EmailAddress)">
__________________
Om Prakash Pant
Click the "Thanks" button if this post helped you.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Update Query Error Tim Johnson Access 2 December 6th, 2007 02:57 PM
SQL Update query (error message) Neal SQL Server 2000 1 August 3rd, 2007 08:57 PM
update query error in from clause [email protected] Classic ASP Databases 1 June 6th, 2005 06:02 AM
error in update query. feras Access ASP 1 May 2nd, 2005 07:05 PM
update query error khautinh SQL Server 2000 2 July 1st, 2004 09:30 PM





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