UpdateCommand on sql resource

3 posts, 0 answers
  1. Aaron
    Aaron avatar
    2 posts
    Member since:
    Feb 2013

    Posted 14 Mar 2013 Link to this post

    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. Plamen
    Admin
    Plamen avatar
    3079 posts

    Posted 19 Mar 2013 Link to this post

    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.
  3. Aaron
    Aaron avatar
    2 posts
    Member since:
    Feb 2013

    Posted 23 Mar 2013 Link to this post

    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
Back to Top