Server Error in '/' Application.

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

Source Error:


Line 31:                 var dt = dv.ProductCategorySelectOne(cid).DefaultView;
Line 32: 
Line 33:                 ProductCatName = progressTitle(dt[0]["ProductCategoryName"]);
Line 34:             }
Line 35: 

Source File: g:\domain-moi\bestcomfort.vn\httpdocs\site.master.cs    Line: 33

Stack Trace:


[IndexOutOfRangeException: Index 0 is either negative or above rows count.]
   System.Data.DataView.GetRow(Int32 index) +4880739
   System.Data.DataView.get_Item(Int32 recordIndex) +12
   site.Page_Load(Object sender, EventArgs e) in g:\domain-moi\bestcomfort.vn\httpdocs\site.master.cs:33
   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.8974; ASP.NET Version:2.0.50727.8974