Reading MS EXCEL data into SQL SERVER

  • Thread starter Thread starter Bharathi Kumar
  • Start date Start date
B

Bharathi Kumar

Hi,
In my windows application, I have created excel.application object
and read the excel data. I saved the data to sql server also.

The problem Iam facing is when I create an instance of
excel.application object, Microsoft excel process is being created and
it stays though I terminate the application.

I gave an input excel file, the problem has read the contents of that
file........

all this went well........... But the thing is EXCEL process being
created. When I see processes in the task manager I found so many EXCEL
processes with my user account.

Pls ............. anyway to solve this...............


I assigned the object to nothing also. still no
use......................

:-(
 
An alternative woould be to use the Jet Engine to access the Excel file via
an OLEDBConnection.
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=<Path and Filename>;Extended
Properties=Excel 8.0;

ETC...
 
Make sure you .Close() the excel application.

Set any Excel object references to null.

You may want to call gc.
 
Thank you very much friends.

I caught the problem.

I should call workbookobject.Close() method.

I was searching the Close method for Excel.Application object.

In the code sample that I found in the net, I didnt remember whether
workbookobject.close() method is written or not.

I just followed the instructions there .....................

Thank you so much ................................

Warm regards
Bharathi Kumar.
 
Back
Top