I have a win form application and my datagrid does not want to fill.
My tabelname is called
OPENINGHOURS
.
The error message I receive is:
What do I have to set in the formload of my GUI to get those openinghours?
DAL:
++++
public static DataTable GetOpeningHoursFromBranch(string branchname)
{
try
{
int brid = BranchDAL.GetBranchID(branchname);
string sql = "SELECT * FROM OPENINGHOURS WHERE BranchId=@brid";
CommandParameterList localparams = new CommandParameterList();
localparams.Add(new CommandParameter("@brid", brid, DbParameterTypes.Int32, ParameterDirection.Input));
localDAC.LocalParameters = localparams;
return localDAC.ExecuteDT(sql, AssignmentTypes.SqlStatement, "OPENINGHOURS");
}
catch (SQLDacException ex)
{
throw new BranchDALException(ex.Message);
}
catch (Exception ex)
{
throw new BranchDALException(ex.Message);
}
}
BLL
++++
public static DataTable GetOpeningHoursFromBranch(string branchname)
{
try
{
return BranchDAL.GetOpeningHoursFromBranch(branchname);
}
catch (BranchDALException ex)
{
throw new BranchBLLException(ex.Message);
}
catch (Exception ex)
{
throw new BranchBLLException(ex.Message);
}
}