Clearing the drop down only for inserted drop down values in database
i have two drop downs with batches and days coming from two different tables now if i select a batch and for that batch already days are assigned the days that are assigned for that particular batch should not be displayed in drop down only for that batch and if i select another batch if those days are not assigned for this batch then those days should be displayed for this for example if batch 1 contains day 1 and day 2 saved in database then they sould not be displayed if i select batch 1 if selected batch 2 as day 1 and day 2 are not saved in database they should be displayed for day2 how can i do thisstring batchname = ddlbatchname.SelectedItem.Value.ToString();
DataTable dt = adm.GetRecords(batchname);
for (int i = 0; i < dt.Rows.Count; i++)
{
for (int j = 0; j < ddlday.Items.Count; j++)
{
string value = dt.Rows[i][1].ToString();
string value1 = ddlday.Items[j].ToString();
if (value == value1)
{
ddlday.Items.RemoveAt(j);
break;
}
}
}