Server Error in '/' Application.

There is no row at position 0.

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: There is no row at position 0.

Source Error:


Line 51:             string LenhCate = @"Select ProGID, ProGName From tbl_ProductsGroup Where ProGShow=1 and ProGStyle=0 and ProGID=" + Convert.ToInt32(PrID);
Line 52:             BANG_tbl_ProductsGroup dtbcate = new BANG_tbl_ProductsGroup(LenhCate);
Line 53:             lblName.Text = dtbcate.Rows[0]["ProGName"].ToString().Trim();
Line 54:             // Lay danh sach
Line 55:             string LenhSQL = @"SELECT ProID, ProName, ProImage, ProPriceIn, ProPriceOut, ProShort, ProLong, ProGID, ProPriceRetail, ProPriceOnline, ProPriceSale, ProPricePromotions FROM tbl_Products WHERE ProShow=1 and ProStyle=0 and ProGID=" + Convert.ToInt32(PrID) + " and ProID=" + Convert.ToInt32(ID).ToString();

Source File: d:\inetpub\vhosts\spchcmc.vn\httpdocs\VN\SanPhamNongNghiepDetail.ascx.cs    Line: 53

Stack Trace:


[IndexOutOfRangeException: There is no row at position 0.]
   System.Data.RBTree`1.GetNodeByIndex(Int32 userIndex) +2126463
   System.Data.DataRowCollection.get_Item(Int32 index) +21
   VN_SanPhamNongNghiepDetail.LoadData() in d:\inetpub\vhosts\spchcmc.vn\httpdocs\VN\SanPhamNongNghiepDetail.ascx.cs:53
   VN_SanPhamNongNghiepDetail.Page_Load(Object sender, EventArgs e) in d:\inetpub\vhosts\spchcmc.vn\httpdocs\VN\SanPhamNongNghiepDetail.ascx.cs:26
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
   System.Web.UI.Control.OnLoad(EventArgs e) +95
   System.Web.UI.Control.LoadRecursive() +59
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +678


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