Thahir Hussain

Thahir Hussain

  • 1.6k
  • 95
  • 9.7k

Excel Data Retrieving

Nov 29 2015 12:48 AM
I have a excel file and i am retriveing data through below code.
It has more than 24000 records and 15 columns.
when i fill in the grid i can't able to retrive all the colums value and gives blank column after 8th column.
Is there any problem with the code.
most of the columns and records are empty. 
 Please help to solve the issue .thanks
 
coN.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Offline.xls;Extended Properties=Excel 8.0;"
coN.Open()
Dim Sql As String
Sql = "Select * from [Stk-offline$]"
Dim cmD1 As New OleDbCommand(Sql, coN)
Dim dA1 As New OleDbDataAdapter(cmD1)
Dim dT1 As New DataTable
dA1.Fill(dT1)
DataGridView1.DataSource = dT1

Answers (3)