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 149:                // renditionID not found. choose one randomly
Line 150:                Random rand = new Random();
Line 151:                _currentIndex = rand.Next(0, _renditions.Rows.Count - 1);
Line 152:                _renditionID = Convert.ToInt32(_renditions.Rows[_currentIndex]["renditionID"]);
Line 153:            }

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

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\thaakur\Render\ShowRendition.aspx.cs:151
   Render_ShowRendition.Page_Load(Object sender, EventArgs e) in e:\web\tagorewe\thaakur\Render\ShowRendition.aspx.cs:73
   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