Click here to Skip to main content
15,888,454 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I know that except third-party and open sources for handling with Excel files, we have 2 standard methods to do, Excel automation (Microsoft.Office.Interop.Excel.dll) or ADO.NET with OLE DB database provider. However I don't know when to use this or that, I think using automation always brings me more controls over the excel files handling, but in some case automation is not necessary while ADO.NET can help.

I don't know what ADO.NET can do for me with handling with Excel files. If possible could you give me some idea on this problem. Examples and external links can help. Also an abbreviated comparison between two of these is OK.


Thanks.
Posted
Comments
Maciej Los 9-Apr-13 3:25am    
Do you need examples of ADO.NET and Excel?
supernorb 9-Apr-13 3:31am    
Examples of both are fine, thanks.

It depends on what you need. But here is a really minimalistic comparison:
- ADO will treat an Excel file as data source (no formatting available), but it is not resource saving
- with interop you get full control, but you will have running Excel instances in the background, thus it is resource expensive; and it is merely usable in single-access situations (can't really use it in an asp.net application)
 
Share this answer
 
Comments
supernorb 9-Apr-13 3:33am    
Thank you, that's great. Look like that I can't use ADO.NET for my case, because the exported excel files have some formated text (bold, colored)...
Zoltán Zörgő 9-Apr-13 3:37am    
Than look for third-party libraries that will allow you to make excel files without interop. There are many good ones out there, some are free, as you mentioned.
Maciej Los 9-Apr-13 3:34am    
+5!
Zoltán Zörgő 9-Apr-13 3:35am    
Thank you.
 
Share this answer
 
Comments
supernorb 9-Apr-13 3:48am    
Thanks, what they said in that thread is almost the same to what Zoltán Zörgő answered.
LaxmikantYadav 9-Apr-13 4:34am    
WC :)
 
Share this answer
 
Comments
supernorb 9-Apr-13 3:46am    
Thank you for the good links to start with.
Maciej Los 9-Apr-13 3:51am    
You're welcome ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900