User-576609655 posted
Hello,
I'm following the book "Beginning ASP.NET E-Commerce in C #, and I can not move because I get an error.
I'm trying to work some days and I can not solve.
I'm on page 325, "Implementing AdminCategories.aspx" in GridView.
When I debug, appears a
error message.
Procedure or function 'CatalogGetCategoriesInDepartment' expects parameter '@ DepartmentID' Which was not supplied.
Detalhes da Exceção: System.Data.SqlClient.SqlException: Procedure or function 'CatalogGetCategoriesInDepartment' expects parameter '@DepartmentID', which was not supplied.
I've already made that part several times, I always get the same error.
I have this.
//retrieve the list of categories in a department
public static DataTable GetCategoriesInDepartment(string departmentId)
{
//Get a configured DbCommand object
DbCommand comm = GenericDataAccess.CreateCommand();
//Set the stored procedure name
comm.CommandText = "CatalogGetCategoriesInDepartment";
//Create a new parameter
DbParameter param = comm.CreateParameter();
param.ParameterName = "@DepartmentID";
param.Value = departmentId;
param.DbType = DbType.Int32;
comm.Parameters.Add(param);
//Execute the stored procedure
return GenericDataAccess.ExecuteSelectCommand(comm);
}
Does anyone know how I can fix this problem?
I have no knowledge in asp.net I am learning.