Server Error in '/' Application.

'minValue' cannot be greater than maxValue.
Parameter name: minValue

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: 'minValue' cannot be greater than maxValue.
Parameter name: minValue

Source Error:


Line 147:                // renditionID not found. choose one randomly
Line 148:                Random rand = new Random();
Line 149:                _currentIndex = rand.Next(0, _renditions.Rows.Count - 1);
Line 150:                _renditionID = Convert.ToInt32(_renditions.Rows[_currentIndex]["renditionID"]);
Line 151:            }

Source File: e:\web\tagorewe\Render\ShowRendition.aspx.cs    Line: 149

Stack Trace:


[ArgumentOutOfRangeException: 'minValue' cannot be greater than maxValue.
Parameter name: minValue]
   System.Random.Next(Int32 minValue, Int32 maxValue) +7945967
   Render_ShowRendition.GetRenditionValues() in e:\web\tagorewe\Render\ShowRendition.aspx.cs:149
   Render_ShowRendition.Page_Load(Object sender, EventArgs e) in e:\web\tagorewe\Render\ShowRendition.aspx.cs:71
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.8974; ASP.NET Version:2.0.50727.8975