title: What NpgsqlDbType should be used to clear "Can't write CLR type" error
body: <p>I am using PostgreSQL as my database. I have an application that is written in </p>
  
  <ul>
  <li>ASP.NET </li>
  <li>C#</li>
  <li>WebForms</li>
  <li>Using Npgsql with PostgreSQL</li>
  </ul>
  
  <p>I have table named <strong>tblAppt</strong> in my database, in that table I have a column named <strong>appttime</strong> that column's Data type is <strong>time without time zone</strong></p>
  
  <p>In pgAdmin4's <strong>Query Tool</strong> if I run the following query:</p>
  
  <pre><code>INSERT INTO tblAppt (appttime) VALUES ('00:30:00');
  </code></pre>
  
  <p>The results are:</p>
  
  <pre><code>INSERT 0 1 Query returned successfully in 105 msec.
  </code></pre>
  
  <p>Which means the record was added in my table,  in the image you can see I have a row: <br>
  <a href="https://i.stack.imgur.com/LDuoJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LDuoJ.png" alt="enter image description here"></a>
  <br>
  Now in my web application I have a text box named <strong>txtCustTime</strong>,  in that text box I enter this value <strong>00:30:00</strong></p>
  
  <p>When I press the submit button I get the following error:</p>
  
  <blockquote>
    <p><strong>System.InvalidCastException</strong> <br>Can't write CLR type System.String with
    handler type TimeHandler</p>
  </blockquote>
  
  <p>Here is a snippet of what happens on the submit:</p>
  
  <pre><code>string insertstmt = "INSERT INTO tblAppt(appttime) VALUES (@ApptTime)";
  NpgsqlCommand cmd = new NpgsqlCommand (insertstmt, con);
  cmd.Parameters.Add("@ApptTime", NpgsqlDbType.Time );
  cmd.Parameters ["@ApptTime"].Value = txtCustTime.Text;
  con.Open ();
  cmd.ExecuteNonQuery (); 
  con.Close ();
  </code></pre>
  
  <p>My question is do I need to cast it because the values in a textbox or use a different datatype, or something else.</p>
  
  <p><strong>PLEASE NOTE:</strong> <em>I have other columns in that table that are not time or dates and they submit fine. My problem seems to be specifically to this particular column type.</em> 
  <br>
  <strong>Additional NOTE:</strong> 
  If I run this on submit the value is added to the database:</p>
  
  <pre><code>string insertstmt = "INSERT INTO tblAppt(appttime) VALUES ('00:30:00')";
  NpgsqlCommand cmd = new NpgsqlCommand (insertstmt, con);
  con.Open ();
  cmd.ExecuteNonQuery (); 
  con.Close ();
  </code></pre>
  
  <p>Which tells me my problem I am not understanding has something to do with the parameter.</p>