title: How to extract date and month part from datetime field in database
body: <p>I have a datetime column named <code>submitted_date</code>. One of it's value in database is <em>5/12/2017 11:09:50 AM</em>. Now I want to extract only date and month part of it. How to display it in a format like "May-12".
  My code is here,</p>
  
  <pre><code>   using (SqlConnection con = obj.getcon())
      {
          con.Open();
          string query = "SELECT submitted_date FROM sample";
          using (SqlCommand command = new SqlCommand(query, con))
          {
              using (SqlDataReader reader = command.ExecuteReader())
              {
                  while (reader.Read())
                  {
                      string x_val = reader[0].ToString(); // 5/12/2017 11:09:50 AM
                  }
              }
          }
          con.Close();
      }
  </code></pre>