Server Error in '/' Application.

Value cannot be null.
Parameter name: key

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.ArgumentNullException: Value cannot be null.
Parameter name: key

Source Error:


Line 175:        dTable.DefaultView.Sort = "displayRank";
Line 176:
Line 177:        foreach (DataRow dRow in dTable.DefaultView.ToTable().Rows)
Line 178:        {        
Line 179:            if (int.Parse(dRow["currencyID"].ToString()) == currentCurrencyID)

Source File: c:\sajtovi\Clarion\controls_new\DropList.ascx.cs    Line: 177

Stack Trace:


[ArgumentNullException: Value cannot be null.
Parameter name: key]
   System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument) +49
   System.Collections.Generic.Dictionary`2.FindEntry(TKey key) +14805238
   System.Collections.Generic.Dictionary`2.get_Item(TKey key) +16
   System.Data.DataView.CopyTo(DataRowView[] array, Int32 index) +167
   System.Data.DataView.GetEnumerator() +53
   System.Data.DataView.ToTable(String tableName, Boolean distinct, String[] columnNames) +644
   DropList.GetCurrencies() in c:\sajtovi\Clarion\controls_new\DropList.ascx.cs:177
   DropList.Page_PreRender(Object sender, EventArgs e) in c:\sajtovi\Clarion\controls_new\DropList.ascx.cs:25
   System.Web.UI.Control.OnPreRender(EventArgs e) +11906436
   System.Web.UI.Control.PreRenderRecursiveInternal() +162
   System.Web.UI.Control.PreRenderRecursiveInternal() +256
   System.Web.UI.Control.PreRenderRecursiveInternal() +256
   System.Web.UI.Control.PreRenderRecursiveInternal() +256
   System.Web.UI.Control.PreRenderRecursiveInternal() +256
   System.Web.UI.Control.PreRenderRecursiveInternal() +256
   System.Web.UI.Control.PreRenderRecursiveInternal() +256
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6875


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