none
Best Practice to upload excel file RRS feed

  • Question

  • Hi,

    Below are my requirement, please suggest me:

    Which is the best way to upload excel file ?

    1. Browse and upload excel file and save it in some folder and disable the upload button then read excel file using sql job for every 2 mins after completion enable the upload button. 

    2. Read excel file in server side like Web api, send it as table type to Sql server and save to DB.

    Now am using the 2nd point but sometimes i will get time out error.

    Regards,

    Naveen 

    Monday, August 26, 2019 12:38 PM

All replies

  • Not seeing your code in regards to timing out is guess work.

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Monday, August 26, 2019 1:36 PM
    Moderator
  • Hi NaveenGE,

    Thank you for posting here.

    >>2. Read excel file in server side like Web api, send it as table type to Sql server and save to DB.

    According to this description, you want to read excel data and save it to database.

    I suggest that you could convert excel data to datatable first. Then, you could save the datatable to database by using SqlBulkCopy Class.

    >> Now am using the 2nd point but sometimes i will get time out error.

    If you want to solve your problem, please provide the related code.

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, August 27, 2019 5:37 AM
    Moderator