Hi again I want to display my table in excel to my datagrid. I want select the 5th row of my spreadsheet as the column header. I have no problems of displaying it in DGV when my column header is at the first row. Now I need to have my column headers at the 5th row and from 6th row onwards that's where my my data starts
Dim cmd As OleDbCommand = New OleDbCommand("SELECT * FROM [Sheet1$]", MyConnection)
MyConnection.Open()
Dim adpt = New OleDbDataAdapter(cmd)
'Here one CommandBuilder object is required.
'It will automatically generate DeleteCommand,UpdateCommand and InsertCommand for DataAdapter object
Dim builder As OleDbCommandBuilder = New OleDbCommandBuilder(adpt)
Dim DtSet = New DataSet()
adpt.Fill(DtSet)
DataGridView1.DataSource = DtSet.Tables(0).DefaultView
MyConnection.Close