Accessing excel files from C#

  • Thread starter Thread starter Mike Grishaber
  • Start date Start date
M

Mike Grishaber

Does anyone know how to read an Excel file using C# and treat the resluts as
RecordSets?

Thanks

Mike
 
Mike,

Do you mean ADODB recordsets, or a data set? If you mean ADODB
recordsets, then you can use COM interop and use the JET OLE DB Provider to
get a recordset in C#.

If you mean a DataSet, then you will have to use COM automation to
access Excel, and get the information programatically to populate the
DataSet.

The Knowledge base article 316126, titled "HOW TO: Use Visual C# .NET to
Automate a Running Instance of an Office Program" should help, it is located
at (watch for line wrap):

http://support.microsoft.com/default.aspx?scid=kb;en-us;316126

Hope this helps.
 
Back
Top