locked
How do I take values from Excel file and write to a database? RRS feed

  • Question

  • I have found a few different things but nothing that seems to work.  What I am trying to accomplish is opening an Excel file, and then taking the contents of that file and writing them to a database.
    • Moved by Paul Zhou Wednesday, February 16, 2011 9:28 AM not supported (From:Visual C# General)
    Monday, February 14, 2011 2:28 PM

Answers

  • you have a few options:

    - SQL Server Integration Services (SSIS): http://msdn.microsoft.com/en-us/library/ms141026.aspx
    - OleDbProvider + ADO.NET: http://endofstream.com/reading-cells-from-excel-file-using-oledbconnection/
    - 3rd party components such as: Aspose.Cells: http://www.aspose.com/categories/.net-components/aspose.cells-for-.net/default.aspx or ExcepPackagePlus http://epplus.codeplex.com/
    - Office automation (should only be used with user interaction)
    - Sharepoint 2010 Excel Services http://msdn.microsoft.com/en-us/library/ms517343.aspx


    Recipient of the Microsoft Community Contributor Award 2011.
    • Proposed as answer by Jesse HouwingMVP Monday, February 14, 2011 6:01 PM
    • Marked as answer by Bruce Song Tuesday, February 22, 2011 9:52 AM
    Monday, February 14, 2011 6:01 PM
    • Marked as answer by Bruce Song Tuesday, February 22, 2011 9:52 AM
    Wednesday, February 16, 2011 3:38 PM

All replies

  • Welcome to MSDN Forums.

    Please retry your query at http://social.msdn.microsoft.com/Forums/is/exceldev/threads (Excel for developers) where you'll find more relared experts.

    Sincerely,

    Yasser.


    LEARN HOW TO USE WINDOWS API DURING A QUICK, SIMPLE AND PRACTICAL HOW TO:
    How To: Changing TextBox blinking caret using Windows API
    Monday, February 14, 2011 2:41 PM
  • Thank you.  My apologies for posting here.
    Monday, February 14, 2011 2:44 PM
  • Thank you.  My apologies for posting here.


    You're welcome :)

    Please feel free to continue here for inserting to database. (after you find out how to reading Excel).


    LEARN HOW TO USE WINDOWS API DURING A QUICK, SIMPLE AND PRACTICAL HOW TO:
    How To: Changing TextBox blinking caret using Windows API
    Monday, February 14, 2011 2:53 PM
  • A better place to discuss how to insert to the database is probably the ADO.Net forums under the data platform development category.

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Monday, February 14, 2011 4:29 PM
  • you have a few options:

    - SQL Server Integration Services (SSIS): http://msdn.microsoft.com/en-us/library/ms141026.aspx
    - OleDbProvider + ADO.NET: http://endofstream.com/reading-cells-from-excel-file-using-oledbconnection/
    - 3rd party components such as: Aspose.Cells: http://www.aspose.com/categories/.net-components/aspose.cells-for-.net/default.aspx or ExcepPackagePlus http://epplus.codeplex.com/
    - Office automation (should only be used with user interaction)
    - Sharepoint 2010 Excel Services http://msdn.microsoft.com/en-us/library/ms517343.aspx


    Recipient of the Microsoft Community Contributor Award 2011.
    • Proposed as answer by Jesse HouwingMVP Monday, February 14, 2011 6:01 PM
    • Marked as answer by Bruce Song Tuesday, February 22, 2011 9:52 AM
    Monday, February 14, 2011 6:01 PM
  • Hi Jonathan,

     

    Based on your description, it’s a problem related to Excel Development. I'm moving this thread from Base “C# General" to “Excel Development" forum, since this issue is related to Excel. There are more experts in that forum.

     

    Thank you for your understanding.


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, February 16, 2011 9:27 AM
    • Marked as answer by Bruce Song Tuesday, February 22, 2011 9:52 AM
    Wednesday, February 16, 2011 3:38 PM