ramco1917 says:
DateTime frDate = Utility.CurrentDateTime().AddMonths(-1);
frDate = Convert.ToDateTime(frDate).ToString(
"dd-MM-yyyy"
);
You are converting the DateTime frDate to string in dd-MM-yyyy format and reassign to DateTime field.
It is not possible to set string value to DateTime datatype.
You need to create another string variable to set the DateTime with dd-MM-yyyy format.
Check below code.
DateTime frDate = Utility.CurrentDateTime().AddMonths(-1);
string fromDate = frDate.ToString("dd-MM-yyyy");