Server Error in '/' Application.

Index -1 is either negative or above rows count.

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.IndexOutOfRangeException: Index -1 is either negative or above rows count.

Source Error:


Line 160:            {
Line 161:                StoresDV.Sort = "Name ASC";
Line 162:                return StoresDV[StoresDV.Find(StoreName)].Row["Alias"].ToString();
Line 163:            }
Line 164:            public string getStoreDomain(string StoreName)

Source File: d:\Inetpub\diamondcodes\App_Code\ClassLibrary.cs    Line: 162

Stack Trace:


[IndexOutOfRangeException: Index -1 is either negative or above rows count.]
   System.Data.DataView.GetRow(Int32 index) +4815691
   System.Data.DataView.get_Item(Int32 recordIndex) +12
   MyTools.Objects.StoreManager.getStoreAlias(String StoreName) in d:\Inetpub\diamondcodes\App_Code\ClassLibrary.cs:162
   stores_MasterPageCoupons.Page_Load(Object sender, EventArgs e) in d:\Inetpub\diamondcodes\stores\MasterPageStoresNew.master.cs:27
   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.Control.LoadRecursive() +141
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.3662; ASP.NET Version:2.0.50727.3668