public virtual DataSet Parse(string fileName, Stream stream) { if (stream != null) { throw new NotSupportedException(); } DataSet ds = new DataSet(); OleDbConnection cnn = new OleDbConnection(_connectionString.Replace("$1", fileName)); cnn.Open(); try { string[] SheetNames = GetSheetNames(cnn); foreach (string SheetName in SheetNames) { /* * if (SheetName.EndsWith("$Print_Titles") || SheetName.EndsWith("$Print_Area") || SheetName.EndsWith("$Database") || SheetName.EndsWith("$Criteria") || SheetName.EndsWith("$Data_form") || SheetName.EndsWith("$Sheet_Title")) ||{ ||} ||else */ if (SheetName.EndsWith("$") || SheetName.IndexOf("$") == -1) { DataTable table = Parse(cnn, SheetName, false); if (table.Rows.Count != 0) { ds.Tables.Add(table); } } } } finally { cnn.Close(); } return(ds); }