title: Convert string to date in ASP.Net
body: <p>I'm trying to convert a <code>string</code> into a date format</p>
  
  <p>My string looks like this</p>
  
  <pre><code>Dim MyString as String = "June 2011"
  </code></pre>
  
  <p>And I'm trying to convert it like this</p>
  
  <pre><code>Convert.ToDateTime(MyString).ToString("MM yyyy")
  </code></pre>
  
  <p>But it's giving me the error </p>
  
  <blockquote>
    <p>Syntax error converting datetime from
    character string.</p>
  </blockquote>
  
  <p>The desired output would be either <code>06/2011</code> or <code>01/06/2011</code>. The value of my string will only ever have the month and year in though.</p>
  
  <p>Any ideas?</p>