Posted on: 12/17/2013 12:20:12 AM | Views : 531

I have to read an excel sheet and save data onto a SQL Server.
I am saving the file first on the server than reading through it.
The file saves on the server but does not read. When I run the code locally on the server by visual studio, it does read the file and upload data to the database.
Please find below the code for reading the file that does not work when I deploy the code to the server.
Dim myApp As New Application myApp.Visible = True Try Dim workbook As Workbook = myApp.Workbooks.Open(fileName, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing) Dim sheet As Worksheet = workbook.Sheets(1) Dim range As Range = sheet.UsedRange Dim introws_count As Integer = range.Rows.Count Dim array(,) As Object = range.Val ...

Go to the complete details ...