What is the best way to read from excel file without losing data? Excel sheet have column formated HH:MM:SS when read it using ADO the time format changed to date and lose actual value:
Sample from excel:
After import to grid view:
Code:
Try
' Clear the DataGridView and the connection string TextBox
Dim Datatable As New DataTable("Sometable")
' Fill the DataGridView and connection string TextBox
Using connection As New OleDb.OleDbConnection(Super.Excel_GetConnectionString(txtZDCalc_txtPerPath.Text, txtZDCalc_txtPerPath.Tag))
connection.Open()
Using adapter As New OleDb.OleDbDataAdapter("SELECT * FROM [" & cboxZDCalc_Sheet.SelectedItem & "]", connection)
adapter.Fill(Datatable)
End Using
End Using
Super.ZD_GetEmployees(Datatable)
Catch ex As Exception
' Display any errors
MessageBox.Show("[" & ex.[GetType]().Name & "] " & ex.Message & ex.StackTrace)
End Try
Why after import time lose the value ?