string filePath = Setting.SourcePath ;
string sheetName = Setting.SourceFile;
string strConn = "";
strConn = (@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filePath + ";Extended Properties=Text");
if (!this.isOpened)
myOleDbConnection = new OleDbConnection(strConn);
try
{
myOleDbConnection.Open();
isOpened = true;
//get all sheets
//DataTable dataTable = myOleDbConnection.GetOleDbSchemaTable(System.Data.OleDb.OleDbSchemaGuid.Tables, null);
//foreach (System.Data.DataRow drow in dataTable.Rows)
//{
// sheetName = drow["Table_Name"].ToString();
// DataTable tableColumns = myOleDbConnection.GetOleDbSchemaTable(OleDbSchemaGuid.Columns, new object[] { null, null, sheetName, null });
// break;
//}
OleDbCommand myOleDbCommand = new OleDbCommand("SELECT * FROM " + sheetName, myOleDbConnection);
dataReader = myOleDbCommand.ExecuteReader();