12,295,457 members (56,749 online)
Rate this:
See more:
```DateTime dt1 = Calendar2.SelectedDate;
DateTime dt2 = Calendar1.SelectedDate;
TimeSpan ts = dt1 - dt2;
double days = ts.Days;
txtDays.Text = days.ToString();
double res = days - 1;
double amt = Convert.ToDouble(txtAmt.Text);
double res1 = amt * res;
double amtperday = Convert.ToDouble(txtAmtPerDay.Text);
double res2 = days * amtperday;
double tot = res1 + res2;
txtTotAmt.Text = tot.ToString();```
Posted 24-Feb-13 0:26am
Edited 24-Feb-13 2:15am
v2

Rate this:

## Solution 1

Use Double.TryParse Method (String, Double%)[^] method instead of Convert.ToDouble Method (String)[^].

My personal opinion: As I looked into your previous questions, it is very sad, that you are using CP instead of trying to google first.
Sergey Alexandrovich Kryukov 12-Mar-13 15:35pm

Agree, a 5.
OP re-posted this exact question again, which is the abuse. We need to report accounts for systematic abuse like that.
OP also posted two fake answers. I'm not going to report it to the abuse watch forum just yet, because forum votes may easily ban the account, but I want just warn Gilbertinino.
—SA

Top Experts
Last 24hrsThis month
 OriginalGriff 595 Richard MacCutchan 435 Karthik Bangalore 319 Peter Leow 258 Richard Deeming 170
 OriginalGriff 8,825 ppolymorphe 5,362 CHill60 5,260 Karthik Bangalore 4,726 Sergey Alexandrovich Kryukov 4,460

Web02 | 2.8.160525.2 | Last Updated 24 Feb 2013