Private Sub readexcel()
Dim cnn As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & txtFileName.Text & "; Extended Properties=Excel 12.0;")
Dim oconn As New OleDbCommand("select * from [Sheet1$]", cnn)
cnn.Open()
Dim adp As New OleDbDataAdapter(oconn)
Dim dt As New DataTable()
Dim ds As DataSet
adp.Fill (dt)
dgvExcelData.SelectionMode = DataGridViewSelectionMode.FullRowSelect
dgvExcelData.EditMode = DataGridViewEditMode.EditProgrammatically
dgvExcelData.DataSource = dt
End Sub
上記のコードは Excel をグリッド ビューに読み込みますが、一部のデータが欠落します。誰かが理由を教えてもらえますか?