Server Error in '/' Application.

The statement terminated. The maximum recursion 100 has been exhausted before statement completion.

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.Data.SqlClient.SqlException: The statement terminated. The maximum recursion 100 has been exhausted before statement completion.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[SqlException (0x80131904): The statement terminated. The maximum recursion 100 has been exhausted before statement completion.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +3317868
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +736
   System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +4061
   System.Data.SqlClient.SqlDataReader.TryHasMoreRows(Boolean& moreRows) +253
   System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more) +291
   System.Data.SqlClient.SqlDataReader.Read() +42
   System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping) +155
   System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue) +215
   System.Data.Common.DataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) +477
   System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +276
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +178
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +122
   HIS_Website.Database.getDepartmentParent(Guid departmentID) in D:\Cbackup\Kanchana\HIS\WebSite\back28Mar2022\backup\HIS_WebsiteCopy\HIS_Website\App_Code\Database.cs:1104
   HIS_Website.Pages.Search.getDepartmentTree(Guid deptID, DataTable dtChild) in D:\Cbackup\Kanchana\HIS\WebSite\back28Mar2022\backup\HIS_WebsiteCopy\HIS_Website\Pages\Search.aspx.cs:938
   HIS_Website.Pages.Search.BuildCategoryMenuPage(Guid deptID, String deptName) in D:\Cbackup\Kanchana\HIS\WebSite\back28Mar2022\backup\HIS_WebsiteCopy\HIS_Website\Pages\Search.aspx.cs:425
   HIS_Website.Pages.Search.BuildSearchResultsDeptPage(Guid deptID, String filter, Boolean isAll, String departmentName, String parentcode) in D:\Cbackup\Kanchana\HIS\WebSite\back28Mar2022\backup\HIS_WebsiteCopy\HIS_Website\Pages\Search.aspx.cs:507
   HIS_Website.Pages.Search.Page_Load(Object sender, EventArgs e) in D:\Cbackup\Kanchana\HIS\WebSite\back28Mar2022\backup\HIS_WebsiteCopy\HIS_Website\Pages\Search.aspx.cs:253
   System.Web.UI.Control.OnLoad(EventArgs e) +106
   System.Web.UI.Control.LoadRecursive() +68
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3785


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