locked
ASP.NET Import from Excel to SQL Server RRS feed

  • Question

  • User-587630019 posted

    What's a good recommendation for an ASPl.NET import process from Excel to SQL Server using C#?

    It needs to include the following functions:

    - Select .xls or .xlsx file from user's local disk drive

    - Select sheet within the Excel file

    - Select with or without header row

    - Preview selected data in a Gridview

    - Import

    Tuesday, January 25, 2011 8:40 PM

Answers

  • User-589637085 posted

    If you are using Client's data file, then you will have to upload that file to your application.

    I have seen code on google creating .xls file.  In your case you have to read .xls (you will get the idea by looking at code).

    Also, is it safe to upload data from client to sql (what if client sends garbage/script and large data files)?



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 26, 2011 1:08 PM

All replies

  • User970350993 posted

    Hi

    check this link.

    http://forums.asp.net/t/1644001.aspx

    Tuesday, January 25, 2011 9:50 PM
  • User-589637085 posted

    http://support.microsoft.com/kb/306397

    step by step instructions. just remember that your excel file must have (.xls) extension


    Tuesday, January 25, 2011 10:21 PM
  • User-587630019 posted

    I'm looking for an ASP.NET C# solution, not SQL Linked Server. 

    Wednesday, January 26, 2011 1:13 AM
  • User-589637085 posted

    If you are using Client's data file, then you will have to upload that file to your application.

    I have seen code on google creating .xls file.  In your case you have to read .xls (you will get the idea by looking at code).

    Also, is it safe to upload data from client to sql (what if client sends garbage/script and large data files)?



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 26, 2011 1:08 PM