First off, don't do that! Do not concatenate strings to build a SQL command. It leaves you wide open to accidental or deliberate SQL Injection attack which can destroy your entire database. Use Parametrized queries instead.
Pass the DateTime values directly, and the number of days directly as numbers - don't play around with converting the to strings, because that just introduces errors when you SQL server is not configured the same as the Web server.
To Calculate the number of days is simple:
int noOfDays = (todate - fromdate).Days;