Remove time from my string c#
<p>I am creating a web app in asp.net in which I am fetching the time from my database through string and printing the string date format in my database is <code>2016-10-15 00:00:00.000</code> and when I print the string the date format is showing like <code>10-Oct-16 12:00:00 AM</code> but I just want to print <code>10-Oct-16</code> I tried </p>

<pre><code>string reformattedDate = DateTime.ParseExact(txtdate, "dd-MM-yyyy", null)
                                 .ToString("MMM d, yyyy"); 
</code></pre>

<p>This but it is me showing:</p>

<blockquote>
  <p>String was not recognized as a valid DateTime</p>
</blockquote>

<p>Can anyone suggest me a better way?</p>