Does anyone know how can I read an excel file line by line in c#.
I found this code which will return the data from excel and display a grindview in c#. However, I j
you can use OleDbDataReader
as below
using (OleDbConnection connection = new OleDbConnection(connectionString))
{
OleDbCommand command = new OleDbCommand(queryString, connection);
connection.Open();
OleDbDataReader reader = command.ExecuteReader();
while (reader.Read())
{
var val1= reader[0].ToString();
}
reader.Close();
}