title: Convert string to a valid MS SQL datetime to use for search in database
body: <p>I saw a lot of answers, most of which include using of <code>DateTime.ParseExact</code> and "CultureInfo.InvariantCulture` but it's not working for me and I'm not sure that those answers are 100% related to the problem I need to solve.</p>
  
  <p>I have table with records from the database. The use can perform search based on different criteria one of which is date. I use some inherited jQuery calendar and in my controller the data from the date filed comes in format <code>"dd/mm/yyyy hh:mm:ss"</code>. I want to be able to use this information to perform search in the database for records on the same date. The one problem is that I want to use only the date but not the time, but I'm not sure in what order to solve this problem so I decided to convert the incoming string to valid MS SQL datetime and see what happen and the to think about the time. </p>
  
  <p>I tried different things, this is my last after which I decide to post here :</p>
  
  <pre><code>    if (!String.IsNullOrEmpty(selDate))
      {
          CultureInfo myCItrad = new CultureInfo("bg-BG", false);
          DateTime parsedDate = DateTime.ParseExact(
             selDate,
             "dd.MM.yyyy hh:mm:ss",
             myCItrad);
          model = model.Where(m =&gt; m.Date == parsedDate);
      }
  </code></pre>