3
I’m trying to use the 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’m trying to read has six columns, when I run this code, it’s only stored in the Dataset 5 columns. I’ve looked at a lot of ways to do the same thing and it’s always the same mistake.
What mistake you’re making?
– Ricardo
none, does the whole process without error charging none, but in the end it does not bring all the information from excel file
– Jeremias Santos