This is a migrated thread and some comments may be shown as answers.

UpdateCommand on sql resource

2 Answers 100 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Aaron
Top achievements
Rank 1
Aaron asked on 14 Mar 2013, 11:59 AM
Hi guys

I'm using a sqlserver view to bring up my fields. My update command however has errors when I try it

This is the resource:
<asp:SqlDataSource ID="SQLLucas" runat="server" ConnectionString="<%$ ConnectionStrings:DatabaseAutoSMSDiary1 %>" SelectCommand="SELECT * FROM [vwBookingsDetails]" UpdateCommand="UPDATE [Bookings] SET [Start Time] = @Start, [End Time] = @End1, [Booking Date] = @BookingDate WHERE [Booking ID] = @ID1">                    
             <UpdateParameters>
                <asp:Parameter Name="Start" Type="DateTime"></asp:Parameter>
                <asp:Parameter Name="End1" Type="DateTime"></asp:Parameter>
                <asp:Parameter Name="BookingDate" Type="DateTime"></asp:Parameter>
                <asp:Parameter Name="ID1" Type="Int32"></asp:Parameter>
            </UpdateParameters>
    </asp:SqlDataSource>

This is my error coming from js function appointmentMoveEnd:

Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: Incorrect syntax near 'nvarchar'.
Incorrect syntax near 'datetime'.
http://localhost:5468/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bAjaxControlToolkit%2c+Version%3d4.1.40412.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d28f01b0e84b6d53e%3aen-AU%3aacfc7575-cdee-46af-964f-5d85d9cdcf92%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%3aen-AU%3aed0b2505-4ecf-45ea-bd67-f51c9ccd1855%3a16e4e7cd%3af7645509%3a22a6274a%3aed16cbdc%3a874f8ea2%3a24ee1bba%3a4c8be21a%3af46195d3%3a650fdad%3ad40f7d5c%3ae91ff703%3a7666c7ed%3aa51ee93e%3a59462f1
Line 9

Thanks
Aaron

2 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 19 Mar 2013, 10:04 AM
Hi Aaron,

 
It is not quite clear what is not working properly from the code provided but you can refer to this on-line demo where similar behavior is implemented.

I am also attaching a sample web page where RadScheduler is bound similarly.

Hope this will be helpful.

All the best,
Plamen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Aaron
Top achievements
Rank 1
answered on 23 Mar 2013, 06:40 AM
HI

I still cannot see why this won't work. I cannot add a file here so I have attached a link to my project on my server.
Please check the file in bookings/bookings.aspx for the telerik scheduler with the update issue. SQL database is also in the file that it is running off.

http://www.renegadedesigns.com.au/AutoSMSDiary.zip

Thanks
Aaron
Tags
Scheduler
Asked by
Aaron
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Aaron
Top achievements
Rank 1
Share this question
or