Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have to Retrieve the column names from the excel sheet and display in the grid control

VB
Using ofd As New OpenFileDialog
       If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then
          txtExcelPath.Text = ofd.FileName
       End If
  End Using 


i got the Excel file from above code.Can u suggest me how to fetch the column name and store it in a temporary table
Posted
Updated 30-Apr-14 6:51am
v4
Comments
CHill60 30-Apr-14 12:18pm    
All you have there is the name of the file, you're not opening it. And why the SQL-server tag on the question?

 
Share this answer
 
Once you populate your DataTable or DataSet then Populate data using
dt.Columns[0].ColumnName
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900