System.DateTime f = dateTimePicker1.Value; System.DateTime g = dateTimePicker2.Value; System.TimeSpan diff = f.Subtract(g); textBox1.Text = Convert.ToString(diff);
System.DateTime todt = dateTimePickerTodate.Value; System.DateTime fromdt = dateTimePickerFromdate.Value; System.TimeSpan diff = todt.Subtract(fromdt);//generally we substract smallar date from bigger else it will return Totaldays in negative sign textBox1.Text = Convert.ToString(diff.TotalDays);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)