title: SQL Server 'Conversion failed when converting date and/or time from character string.' when inserting date values from WinForm DateTimePicker
body: <p>I'm trying to insert date value from <code>DateTimePicker</code> element in WinForms to a user defined method in the Table Adapter.</p>
  <p>This is the function that gets data from the <code>DateTimePicker</code> element and inserts into the user defined method in the Table Adapter.</p>
  <pre><code>    private void btn_searchRooms_Click(object sender, EventArgs e)
      {
          string checkIn = dtPicker_checkIn.Value.ToString(&quot;yyyy'/'MM'/'dd&quot;);
          string checkOut = dtPicker_checkOut.Value.ToString(&quot;yyyy'/'MM'/'dd&quot;);
  
          var dt = roomsTableAdapter.GetAvailableRooms(checkIn, checkOut);
  
          dtGridView_availableRooms.DataSource = dt;
      }
  </code></pre>
  <p>This is the user defined method in the Table Adapter that queries data from SQL server.</p>
  <p><a href="https://i.stack.imgur.com/bRSP5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bRSP5.png" alt="enter image description here" /></a></p>
  <p>This is schema of the table that I'm querying data from</p>
  <p><a href="https://i.stack.imgur.com/wY3Lz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wY3Lz.png" alt="enter image description here" /></a></p>
  <p>The method works fine without an issue but when I insert the date value from <code>DateTimePicker</code> to its parameter , it literally throws &quot;Conversion failed &quot; exception. The format of date is converted to &quot;yyyy/MM/dd&quot; to store it in the table with DATE data type column.</p>
  <p>This is db fiddle for more information about the tables and data types that I'm storing <a href="https://dbfiddle.uk/?rdbms=sqlserver_2019&amp;fiddle=a170e1036dc5715d2362fa9f1dd139bb" rel="nofollow noreferrer">db fiddle</a></p>
  <p>How can I send date from C# to SQL Server in &quot;yyyy/MM/dd&quot; format?
  Is there any workaround for this kind of issue?</p>