After inspecting you're code there are some things that do not make sense to me at all. For example:
for (int i = 0; i < dt.Rows.Count; i++)
{
if (dt.Rows[0]["Frequency"].ToString() == "One Time")
{
...
}
}
Why are you making a for loop and then checking dt.Rows[0] all the time instead of dt.Rows[i]?
Then another thing:
DataTable dt1 = new DataTable();
dt1.Load((IDataReader)objDBAccessCF.ExecuteForReader(Selectcmd, para));
if (dt.Rows.Count == 1)
{
}
else
{
}
Why do you make a second datatable called
dt1 and then do another check (
dt.Rows.Count == 1) instead of (
dt1.Rows.Count == 1)?
Right those things i was just wondering about. Seems to me like you should insert this code inside the else statement:
if (dt1.Rows.Count == 1)
{
}
else
{
dt.Rows.RemoveAt(i);
}