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 234:        table.DefaultView.RowFilter = "ServiceID=" + id;
Line 235:        DataView defaultView = table.DefaultView;
Line 236:        this.lbltitledetail_sub.Text = defaultView[0]["ServiceName_EN"].ToString();
Line 237:        this.lblactive.Text = this.lbltitledetail_sub.Text;
Line 238:        this.s = defaultView[0]["ServiceContent_EN"].ToString();

Source File: c:\WEBSRC\W_SITE\wECCV2\Service.aspx.cs    Line: 236

Stack Trace:


[IndexOutOfRangeException: Index 0 is either negative or above rows count.]
   System.Data.DataView.GetRow(Int32 index) +5036711
   System.Data.DataView.get_Item(Int32 recordIndex) +12
   Service_Service.GetServiceByID(Int32 id) in c:\WEBSRC\W_SITE\wECCV2\Service.aspx.cs:236
   Service_Service.InitializeComponent() in c:\WEBSRC\W_SITE\wECCV2\Service.aspx.cs:90
   Service_Service.OnInit(EventArgs e) in c:\WEBSRC\W_SITE\wECCV2\Service.aspx.cs:113
   System.Web.UI.Control.InitRecursive(Control namingContainer) +140
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +480


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