How Do I Upload xls sheet Read it and save it into database in Blazor WASM

Prathamesh Shende 511 Reputation points
2021-09-17T19:46:31.14+00:00

I saw so many examples about bulk upload from excel sheet into database. But the problem is all videos and tutorials are in Blazor Server. So many ready example also available on youtube.
I want develop this blazor wasm and also have asp.net core web api hosted with it . So how do I implement it ? any example please or tutorial.

Developer technologies | .NET | Blazor
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 81,976 Reputation points Volunteer Moderator
    2021-09-17T20:25:58.84+00:00

    for Blazor WASM its a standard file upload (<input file>) to the asp.net core webapi. You should be able to find lots of asp.net core examples.

    https://learn.microsoft.com/en-us/aspnet/core/blazor/file-uploads?view=aspnetcore-5.0&pivots=server

    if you meant to parse the xls sheet in blazor then you need an excel parser that runs in blazor. find a .netstandard 2.0 library version that supports memory streams to read the excel file. if you can not find one, there are javascript ones you could use.

    note: with WASM blazor you need to careful of the file sizes

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.