try
{
ddl.SelectedValue = “value_from_db”;
ddl.DataSoure = myDataSource();
ddl.DataValueField = “value”;
ddl.DataTextField = “text”;
ddl.DataBind();
}
catch (ArgumentOutOfRangeException myException)
{
//exception will be caught if SelectedValue is not in the ddl
//no exception caught if SeletedValue is in the ddl
if (ddl.items.count > 0)
ddl.SelectIndex = -1;
}