Thursday, January 19, 2012

Get Number of Day from Two Datetime Picker Value

We can easily find out the Total number of day from Two Datetime Picker value using TimeSpan

  int totalDay=0;  
  TimeSpan ts = new TimeSpan(Convert.ToDateTime(objApplyLeave.Apply_ToDate).Ticks - Convert.ToDateTime(objApplyLeave.Apply_FromDate).Ticks);  
   totalDay = ts.TotalDays + 1 ;  

SQL Get all Index create script from Database

To get all script from database as a create new index into another database you can use the following --Get all Index Script SELECT...