2
I am developing a C# application that consumes data from a spreadsheet and at some point I need a query string that will feed a variable.
For example:
strComando1 = "SELECT TOP 2 ColunaGenerica1, ColunaGenerica2 FROM ["+ planilha +"]";
I wanted to know if it is possible and how can I consume data from the first two columns, for example, without specifying their name, since the name of the columns may vary according to the user’s import.
Provider and connection:
private static OleDbConnection conexao = new OleDbConnection();
strConexao = string.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=\"Excel 12.0;HDR=Yes;IMEX=0\"", caminhoArquivo);
conexao.ConnectionString = strConexao;
private static DataTable tabelaDeSaida;
Which carrier is using ? puts the connection code... command... etc
– Rovann Linhalis
Done. I added information about the Preview and connection.
– Gabriel Marques