 <p>The problem with the date format is because you are converting it to a string and then back to a DateTime value. Depending on the culture settings on the specific server this may or may not work. It may also misinterpret the data, e.g. transforming a date from 2013-10-12 to 2013-12-10.</p> <pre><code>DateTime datet = new DateTime(year,month,day); startDateParam.Value = datet; endDateParam.Value = datet; </code></pre> <p>"note that the server stored datetime with format '1900-01-01 00:00:00.000'"</p>