Connecting to database does not work

I have downloaded the following example;

https://github.com/SyncfusionExamples/blazor-scheduler-crud

But when I run it, it displays the scheduler, but I cannot read or write to the database.  When I create a new appointment, it just disappears, does not get written to the database and there are no errors in the log (this is using the provided mdf file).

To test that the OData source was working, I tried to read the json by adding /odata/ODataV4 to my local URL, but that just returned the "Sorry there's nothing at this address" message, so there is clearly something fundamentally wrong with my setup.

I have tried creating a local database and connecting to that, but I get the same result.  Any suggestions would be greatly appreciated.


9 Replies

RM Ruksar Moosa Sait Syncfusion Team January 28, 2022 12:27 PM UTC

Hi Peter,


We have prepared a sample to perform CRUD actions from the database. Kindly try the attached sample and let us know if it meets your requirement.

Regards,

Ruksar Moosa Sait


Attachment: ej2blazorschedulecrudsamplewithexternaldraganddrop1421638511_a83096f8.zip


DY Dylan February 10, 2022 07:35 AM UTC

Hello, I have also had troubles with this tutorial:

https://www.syncfusion.com/blogs/post/easily-synchronize-blazor-resource-scheduler-with-restful-services.aspx

After following along and even downloading the source code and putting my localDb connection strings in I still am not able to perform CRUD operations with the scheduler. Is there something missing that the tutorial overlooks?



RM Ruksar Moosa Sait Syncfusion Team February 11, 2022 01:35 PM UTC

Hi Dylan,


Currently, we are checking the reported issue at our end and will update the validation details on February 14, 2022. We appreciate your valuable patience.


Regards,

Ruksar Moosa Sait



DY Dylan February 15, 2022 12:44 AM UTC

Thank you for responding.  I look forward to the update today.



VM Vengatesh Maniraj Syncfusion Team February 15, 2022 06:47 PM UTC

We have fixed the reported problem and merged the changes in our sample repo. Please find the sample below.

Synchronizing Blazor Scheduler events and resource data with RESTful services.




DY Dylan replied to Vengatesh Maniraj February 15, 2022 09:38 PM UTC

Vengatesh,


Thank you for the support as updating on the scheduler through my database works now.  The only issue that does not work is deleting a recurring series/event that has a series.  Is your team familiar with this issue as well?


The console error when deleting a recurring series is:


blazor.webassembly.js:1 crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]

      Unhandled exception rendering component: The format of value 'batch_cd095e7e-ffc6-45cf-9885-e944be6f2986' is invalid.

System.FormatException: The format of value 'batch_cd095e7e-ffc6-45cf-9885-e944be6f2986' is invalid.

   at System.Net.Http.Headers.MediaTypeHeaderValue.CheckMediaTypeFormat(String mediaType, String parameterName)

   at System.Net.Http.Headers.MediaTypeHeaderValue..ctor(String mediaType)

   at System.Net.Http.StringContent..ctor(String content, Encoding encoding, String mediaType)

   at Syncfusion.Blazor.Data.HttpHandler.PrepareRequest(RequestOptions options)

   at Syncfusion.Blazor.DataManager.<SaveChanges>d__163`1[[BlazorScheduler.Shared.Models.EventModel, BlazorScheduler.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()

   at Syncfusion.Blazor.Schedule.Internal.CrudModule`1.<ProcessEntireSeries>d__23[[BlazorScheduler.Shared.Models.EventModel, BlazorScheduler.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()

   at Syncfusion.Blazor.Schedule.Internal.CrudModule`1.<DeleteEvents>d__13[[BlazorScheduler.Shared.Models.EventModel, BlazorScheduler.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()

   at Syncfusion.Blazor.Schedule.Internal.CrudModule`1.<DeleteEvents>d__13[[BlazorScheduler.Shared.Models.EventModel, BlazorScheduler.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()

   at Syncfusion.Blazor.Schedule.Internal.AlertWindow`1.<OnDeleteSeriesClick>d__65[[BlazorScheduler.Shared.Models.EventModel, BlazorScheduler.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()

   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)

   at Syncfusion.Blazor.Internal.SfBaseUtils.<InvokeEvent>d__14`1[[Microsoft.AspNetCore.Components.Web.MouseEventArgs, Microsoft.AspNetCore.Components.Web, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext()

   at Syncfusion.Blazor.Buttons.SfButton.OnClickHandler(MouseEventArgs args)

   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)

   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)



VM Vengatesh Maniraj Syncfusion Team February 17, 2022 08:19 AM UTC

Hi Dylan,


Sorry for the inconvenience.

Currently, we are checking the reported issue and will get back to you by 18th Feb 2022.


Regards,

Vengatesh 



DY Dylan replied to Vengatesh Maniraj February 20, 2022 10:33 PM UTC

Thank you Vengatesh




BS Balasubramanian Sattanathan Syncfusion Team February 22, 2022 09:22 AM UTC

Hi Dylan,

Thanks for your valuable patience.

We checked the reported issue with the shared sample. On further analyzing, we found that $batch request has generated for your case, when deleting event. We let you know that ASP.NET Core (Blazor) Web API with batch handling is not yet supported by ASP.NET Core v3+. Hence it is not feasible from us to support batch mode CRUD operation, until ASP.NET Core provide the support for the batch handler.    
  
Please find the general GitHub link below.   
  
   
  
Regards,  
Balasubramanian S 


Loader.
Up arrow icon