26 thoughts on “Import / export database data from / to Excel using ASP.NET and C#

  1. Error 1 'importeport.MuDatabaseEntities': type used in a using statement must be implicitly convertible to 'System.IDisposable' C:UsersUserDocumentsVisual Studio 2010ProjectsimporteportimporteportDefault.aspx.cs 33 13 importeport

    i m getting this error

  2. This sample application works great! The only critique I have is when you are referencing Microsoft.Jet.OleDb 12.0 as a provider. I went insane looking for that driver!! It's not anywhere to be found and you cannot implicitly install it so after a day or so of looking for a solution I've simply replaced it with Microsoft.ACE.OleDb 12.0 which IS installed on my machine and will work perfectly fine with both Importing Excel 2016 data and Exporting Excel data without any errors or issues.

  3. hi.
    Pls what of if u want to verify if the data exist in the SQL table before uploading ? @sourav mondal

  4. sourav mondal

    how i can update date or time in database?.. it doesn't allowing be to convert to datetime datatype …..any solution sir…..

  5. .Thanks for sharing your expertise Sourav….. it would be great if you can add some audio comments on what you are doing… would help to connect the viewers more with the topic!

  6. There are some drawbacks to OLEDB, for example if you check the generated XLSX file (41:14) you'll notice that cells E8, E10, F2, etc. have a small green triangle that indicates a data type error. Unfortunately you cannot change this with OLEDB.
    There are some other drawbacks that are listed here:
    stackoverflow.com/questions/3608248/which-one-is-best-oledb-or-excel-object-or-database#3885915
    If you're not effected by those limitations then great, but if you are then you'll need to use some other approach, for example:
    www.gemboxsoftware.com/support/articles/import-export-dataset-xls-xlsx-ods-csv-html-net

  7. To Mr Sourav Mondal
    Thanks for your Online Support…it works…

  8. I do not speak much English, but I'll try to explain my problem using translator :D.
    I need to export a report filled with a dataset to excel.
    I understand how to put headers but not how to fill it with the database.

    May someone help me?

  9. sir im having a doubt.. my mini project is similar to ur video. here i have created data of students and teachers.. suppose there are totally 20 staffs and 200 students. then how to divide 20 groups of students allocating each staff for that each groups?

  10. hello sir
    i am getting an error in this part
    catch (Exception)
                    {
                        throw;
                    }
    its saying System.IO.DirectoryNotFoundException: Could not find a part of the path 'c:usersarijitdocumentsvisual studio 2015ProjectsAspImportExport1AspImportExport1ImportDocumentc59b8ba2-a5bd-4c66-8368-ebaa6281c7b8.xlsx'.
    can you pls help me what its asking me to do????

Leave a Reply

Your email address will not be published. Required fields are marked *