Server Error in '/55' Application.

'ddl_province' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: 'ddl_province' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value

Source Error:


Line 82:         while (dr.Read())
Line 83:             ddl.Items.Add(new ListItem(dr[1].ToString(), dr[0].ToString()));
Line 84:         ddl.DataBind();
Line 85:     }
Line 86: 

Source File: d:\WebApp\Info\App_Code\common\geoConDB.cs    Line: 84

Stack Trace:


[ArgumentOutOfRangeException: 'ddl_province' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value]
   System.Web.UI.WebControls.ListControl.PerformDataBinding(IEnumerable dataSource) +2752532
   System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +303
   System.Web.UI.WebControls.ListControl.PerformSelect() +38
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +76
   geoConDB.DropdownListAll(DropDownList ddl, String sql) in d:\WebApp\Info\App_Code\common\geoConDB.cs:84
   fCom_1.zoneChange(Object sender, EventArgs e) in d:\WebApp\Info\fCon.aspx.cs:128
   fCom_1.Page_Load(Object sender, EventArgs e) in d:\WebApp\Info\fCon.aspx.cs:50
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +52
   System.Web.UI.Control.OnLoad(EventArgs e) +97
   System.Web.UI.Control.LoadRecursive() +61
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +693


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4075.0