0
I have a problem to return the excel data to a Datagridview... I am using the commands below
Dim connectionStringExcel As String = "Driver={0};DriverId=790;
Dbq={1};DefaultDir={2};Extended Properties=""HDR=yes"";"
Dim driverExcel As String = "{Microsoft Excel Driver (*.xls)}"
conn = New OdbcConnection(String.Format(connectionStringExcel, driverExcel, odb.FileName, Path.GetDirectoryName(odb.FileName)))
cmd = New OdbcCommand("select * from [Plan1$]", conn)
da = New OdbcDataAdapter(cmd)
dt = New DataTable
da.Fill(dt)
The problem is that when a column has many numerical values it considers as a numerical column and does not return alphanumeric data, I would like to know how to define the data type of the query.
I’ve been there, just change the TYPE column in EXCEL.
– PauloHDSousa
The Column was already in the General Category, I changed the cell formatting to Text but still did not return the data.
– Kleber Nunes
Give a SAVE AS and change the name.
– PauloHDSousa
I did the process and still did not solve. Obs. I am using Office 2013.
– Kleber Nunes
Maybe @Marcelo Bonifazio can help you.
– PauloHDSousa