1
Answer

find yearly, monthly

hi! frnds
using  Entity Framework 
 
How to get particular year data from the data base using Entity frame work.
like
 S.no Dateofjoin(yyyy-mm-dd format)
 2015-09-01
 2 2014-09-31
 3 2015-09-22
 4 2014-08-25
 
 1. I will give 2015 and 09 (month)
2015-09-31
S.no Dateofjoin(yyyy-mm-dd format)
1 2015-09-01


3 2015-09-22
 
 
2.  i will give 2015(yyyy)
 
 
 s.no Doj
 1 2015-09-01
3 2015-09-31
 
 please provide solution 

Answers (1)

0
Photo of Kunal Vaishya
NA 4.1k 266.1k 12y
Dear this is For 15 days you can change as per your requirment




Please try thic Procedure put this om main for load event
its also restrict of date change itvery use full

let me know


  private DateTime RegDate;
  private DateTime todayDate;
  private void CheckLicenceAgreement()
  {
  try
  {
  //If Not Exist The Add Date Firet Time
  if (Convert.ToString(Application.UserAppDataRegistry.GetValue("RegDate")) == "")
  {
  RegDate = DateTime.Now;
  RegDate  = RegDate.AddDays(15);

  Application.UserAppDataRegistry.SetValue("RegDate", RegDate.ToString("yyyyMMdd"));
  Application.UserAppDataRegistry.SetValue("ApplicationStart", "1");
  }
  else
  {
  //Check It

  Int32 Regdt;
  Int32 todt;
  Regdt = Convert.ToInt32(Application.UserAppDataRegistry.GetValue("RegDate"));
  todt = Convert.ToInt32(System.DateTime.Now.ToString("yyyyMMdd"));

  if ((todt > Regdt) || (Convert.ToString(Application.UserAppDataRegistry.GetValue("ApplicationStart")))=="0")
  {
  Application.UserAppDataRegistry.SetValue("ApplicationStart", "0");
  Application.Exit(); 
  }
  }
  }
  catch (Exception ex)
  {
  Application.Exit(); 
  } 
  }