i am imorting excel data to sql db uisng asp.net
i have 2 issue regrading the same

1) suppose i import a A.xls when the .net application is executed
it gets imported correctly for the first time
but if i try to import the same file again i get error as this file is used by some process...

i have
private void KillUnusedExcel()
System.Diagnostics.Process[] killUnused = System.Diagnostics.Process.GetProcessesByName("Excel");
foreach (System.Diagnostics.Process open in killUnused)
if (open.MainWindowTitle.Length == 0)


i closed the connection string also but still the excel doesnot quit from memory
so how to relase the excel from memory once the importing of one file is done

2) Al l records not getting imported in production server but works fine in development server
i am having 50 records in my excel sheet
in my developemnt server all 50 recods gets imported
i published the same code in my production server & using the same exxel files
so all 50 records shld be imported
but only one record is imported & no error msg is thrown
so asked abyt the remaining records
as the code is same ,database is same & excel sheet is aslo same