0

I have a page that loads some request history based on the parameter selected by the user. But for the first time it will load all the request history. So I wrote the procedure that takes current user and if user puts any parameter it takes it as well, else all the parameters except the current user will be null. Now int the code behind page, I am calling the method from the business logic but having some problem with the parameter as this time it will show everything according to the current user id, and other parameter will null. Here is part of the code I am getting error.

var candidateRequestHistory = CandidateRequestManager.GetCandidateRequestHistory(((int)Session[CommonHelper.Constants.(CURRENT_CANDIDATE)),'','',0,'','')]);
                grdCandidateRequestHistory.DataSource = candidateRequestHistory;
                grdCandidateRequestHistory.DataBind();

want to pass all the parameters null except the HumanResourceID. (int HumanresourceID,String framework,String SkillName,int SkillLevel,DateTime fromDate,DateTime toDate)

6
  • Which parameter do you want to pass as null? What is the type of that parameter? May 31, 2015 at 11:48
  • (int HumanresourceID,String framework,String SkillName,int SkillLevel,DateTime fromDate,DateTime toDate) want to pass all the parameters null except the HumanResourceID
    – Ovic
    May 31, 2015 at 11:49
  • And which one do you want to pass as null? I'm assuming it's one of the int or datetime parameters, in which case you will have to change the method signature as well, to accept either int? or DateTime?. May 31, 2015 at 11:50
  • Can you please explain it with a little bit of details, it will be helpful for me
    – Ovic
    May 31, 2015 at 11:54
  • You can't pass null to an int or a DateTime parameter. You will have to change the parameter types of the method to int? or DateTime? (add a question mark) in order to get a type that handles null. May 31, 2015 at 11:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.