2
Guys, I’m trying to read a data from an excel table in c#,my code is like this:
string resp;
string rota= "D:/Users/e608871/documents/visual studio 2010/Projects/CEMIGID/CEMIGID/CEMIGID.xlsx";
var excel = new ExcelQueryFactory(rota);
var res = (from row in excel.Worksheet("Sheet1")
let item = new Program
{
ID = row[0].Cast<string>(),
diretorio = row[1].Cast<string>()
}
select item).ToList();
excel.Dispose();
foreach (var item in res)
{
resp = item.ID;
}
but it doesn’t read, it just opens the console and shows nothing
It’s because there’s no
Console.WriteLine()
ai. What did you want him to show?– Jéf Bueno
it is pq I am debugging and in debug it is not getting the values
– Guilherme Augusto Bueno Borba