Server Error in '/' Application.

The parameterized query '(@DEPARTMENT_ID nvarchar(4000))SELECT DEPARTMENT_ID, NAME, PAREN' expects the parameter '@DEPARTMENT_ID', which was not supplied.

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 parameterized query '(@DEPARTMENT_ID nvarchar(4000))SELECT DEPARTMENT_ID, NAME, PAREN' expects the parameter '@DEPARTMENT_ID', which was not supplied.

Source Error:


Line 96:             CurrentDepartmentCmd.Parameters.Clear();
Line 97:             CurrentDepartmentCmd.Parameters.AddWithValue("@DEPARTMENT_ID", parent_id);
Line 98:             SqlDataReader ParentDepartmentReader = CurrentDepartmentCmd.ExecuteReader();
Line 99:             if (!ParentDepartmentReader.HasRows)
Line 100:            {

Source File: c:\inetpub\wwwroot\Cool-Lux ASP\item.aspx.cs    Line: 98

Stack Trace:


[SqlException (0x80131904): The parameterized query '(@DEPARTMENT_ID nvarchar(4000))SELECT DEPARTMENT_ID, NAME, PAREN' expects the parameter '@DEPARTMENT_ID', which was not supplied.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1968826
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4907355
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2412
   System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +59
   System.Data.SqlClient.SqlDataReader.get_MetaData() +83
   System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +293
   System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +954
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +162
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32
   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +141
   System.Data.SqlClient.SqlCommand.ExecuteReader() +89
   _products.Page_Load() in c:\inetpub\wwwroot\Cool-Lux ASP\item.aspx.cs:98
   System.Web.Util.CalliHelper.ArglessFunctionCaller(IntPtr fp, Object o) +8
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +8772995
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.8964; ASP.NET Version:2.0.50727.8962