In the below code instead of specifying the tab name.. Is there anyway we can just say “select * from [tab1]”? what ever the tab name might be..
OleDbCommand excelOledbCommand =
new OleDbCommand("Select * From [Sheet1$]", excelOledbCon);
This might help
Tips for reading Excel spreadsheets using ADO.NET
OleDbConnection.GetOleDbSchemaTable Method
Something like