I'm trying to use C # to read an Excel file, but every time I run the code the last column is not stored
Reading Code:
//Cria conexão com a planilha
OleDbConnection conexao = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + caminhoParaOArquivo + ";Extended Properties='Excel 12.0 Xml;HDR=YES';");
//Cria um Adapter para executar o comando Select
OleDbDataAdapter adapter = new OleDbDataAdapter("SELECT * FROM [Result$]", conexao);
//Cria um DataSet para armazenar os dados da consulta
DataSet ds = new DataSet();
//Abre a conexão
conexao.Open();
adapter.Fill(ds);
The file I am trying to read has six columns, so when I run this code, they are only stored in the DataSet 5 columns. I've tried several ways to do the same thing and it always gives the same error.