We are required to send our weekly timesheets by Friday morning. I
sometimes forget to send them until Friday evening, if I am reminded,
or by the next Monday.
To solve my problem, I am writing a quick and dirty utility that will
mail timesheets out of a specific folder every Friday 9 AM whether I am
on my seat or not. It's fun.
I am keeping the list of timesheet files I have already sent in an XML
file. On program start up, I load it into a dataset and then into a
hashtable and then I dispose the dataset. Here's the code snippet under
discussion:
string sFile =
ConfigurationSettings.AppSettings["AlreadySentTimeSheetsDataSet"];
if ( !File.Exists( sFile ) )
return;
DataSet ds = new DataSet();
ds.ReadXml(sFile);
if (ds.Tables.Count 0)
if ( ds.Tables[0] != null)
for (int i = 0; i < ds.Tables[0].Rows.Count - 1; i++)
_alreadySentTimeSheets.Add(ds.Tables[0].Rows[i][0],
ds.Tables[0].Rows[i][0]);
The problem is that the dataset does not contain any tables. The XML
file does have 25 records and is well formed and valid.