Hello.
I'm trying to read from excel file with oleDB provider using C#:
using (var fileConnection = new OleDbConnection(fileConnectionString))
{
var command = new OleDbCommand(@"Select SourceName, [ExternalID] FROM [page1$]", fileConnection);
fileConnection.Open();
var reader = command.ExecuteReader();
while (reader.Read())
{
yield return new Source
{
//some code
};
}
}
. The only problem is that some headers in excel file have a square bracket in their name like [ExternalID]
. Is it possible to read them? How can I do it?
Thank you for your help!