title: An un-representable DateTime for year, Month and Day parameters in C#
body: <p>I am facing some error like "Year, Month, and Day parameters describe an un-representable DateTime". But this problem is occurring when I am using another Database else the code which i have written is working fine.</p>
  
  <p>For checking purpose I changed my PC Datetime from November to december than the same code in different database working fine. But I am not getting how to solve this bug. I have attached some code below where it is crashing.</p>
  
  <pre><code>var vi = session.Query&lt;TJERecurMaster&gt;().ToList();
  
                  TJEShedulDetail tp = new TJEShedulDetail();
  
                  var RecurMasterList = (from v in vi
                                         join jj in session.Query&lt;TJEShedulDetail&gt;()
                                         on v.FMasterID equals jj.TJERecurMaster.FMasterID into jjv
                                         from jv in jjv.DefaultIfEmpty(tp)
                                         where v.FInactive == false &amp;&amp; v.TSCCompany == objCompany &amp;&amp; v.TSCProperty == objProp
                                         orderby v.FDescription descending
                                         select new RecurMasterNotification
                                         {
                                             TSCompanyID = CompanyID,
                                             JeRecurDetail = v.TJERecurDetails,
                                             FMasterID = v.FMasterID,
                                             FScheduleID = jv.FScheduleID,
                                             FDescription = v.FDescription,
                                             FPostdate = jv.FLastNotification != null ? jv.FLastNotification : (v.FSetDay != 0 ? new DateTime(DateTime.Now.Year, DateTime.Now.Month, Convert.ToInt32(v.FSetDay)) : DateTime.Now),
  
                                             FAmount = v.TJERecurDetails.Where(P =&gt; P.FTranType == "D").Sum(P =&gt; P.FAmount)
                                                          - v.TJERecurDetails.Where(P =&gt; P.FTranType == "C").Sum(P =&gt; P.FAmount),
                                             FLastCreated = jv.FLastNotification,
                                             FNotes = v.FNotes,
                                             FJEType = v.FJEType,
                                             FInactive = v.FInactive,
                                             Frequency = jv.FFrequency,
                                             FDateSelection = jv.FDateSelection,
                                             FNextNotification = jv.FNextNotification,
                                             FLastCreatedString = jv.FLastNotification == jv.FNextNotification ? string.Empty : jv.FLastNotification.ToString(),
                                         }).ToList();
  </code></pre>
  
  <p>What is the solution for this type of error?</p>