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 19:         Session("index") = -1
Line 20:         Session("selected") = dbl.SelectAllwhereLikeFullText("news", "html", txtSearch, "domainCode", General.domain("code"), "ReadedByAdmin", "1")  'General.solrSearch(p, 50)
Line 21:         If Session("selected").rows(0).item("title") = txtSearch Then
Line 22:             Response.Redirect(Session("selected").rows(0).item("id").ToString + "/" + Session("selected").rows(0).item("link"))
Line 23:         End If

Source File: C:\Files\iWeb\iWebCode\searchResult.aspx.vb    Line: 21

Stack Trace:


[IndexOutOfRangeException: There is no row at position 0.]
   Microsoft.VisualBasic.CompilerServices.Container.InvokeMethod(Method TargetProcedure, Object[] Arguments, Boolean[] CopyBack, BindingFlags Flags) +490
   Microsoft.VisualBasic.CompilerServices.NewLateBinding.CallMethod(Container BaseReference, String MethodName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, BindingFlags InvocationFlags, Boolean ReportErrors, ResolutionFailure& Failure) +321
   Microsoft.VisualBasic.CompilerServices.NewLateBinding.InternalLateIndexGet(Object Instance, Object[] Arguments, String[] ArgumentNames, Boolean ReportErrors, ResolutionFailure& Failure, Boolean[] CopyBack) +340
   Microsoft.VisualBasic.CompilerServices.NewLateBinding.ObjectLateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) +616
   Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) +1571602
   searchResult.Page_Load(Object sender, EventArgs e) in C:\Files\iWeb\iWebCode\searchResult.aspx.vb:21
   System.Web.UI.Control.OnLoad(EventArgs e) +108
   System.Web.UI.Control.LoadRecursive() +90
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1533


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