0
什麼是從Excel文件中讀取而不丟失數據的最佳方法?當使用ADO讀取時間格式更改爲日期和失去實際價值SS:從Excel從excel文件讀取而不丟失數據的最佳方法是什麼? Vb.net
樣品: Excel工作表已列格式化HH:MM
進口到網格視圖後:
代碼:
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
爲什麼導入時間後失去了價值?