title: Inserting data into PostgreSQL jsonb column with Daper.Net and NPGSQL
body: <p>I'm trying to insert JSON data into a JSONB PostgreSQL column using Dapper.Net.</p>
  
  <p>The <a href="http://www.npgsql.org/doc/faq.html" rel="noreferrer" title="NPGSQL Documentation">NPGSQL Documentation for JSONB</a> gives specific instructions to use the <code>NpgsqlDbType.Jsonb</code> datatype.</p>
  
  <p>With Dapper, I'm trying to add this as a custom parameter without success. </p>
  
  <pre><code>using (var conn = myconnection)
  {
      var sql = "INSERT INTO mytable (jsonbody) VALUES (@jb);";
      dp =  new DynamicParameters();
      dp.Add("jb", stringOfJsonData, (DbType)NpgsqlDbType.Jsonb);
      await conn.ExecuteAsync(sql,dp);                    
  }                
  </code></pre>
  
  <p>The error I'm receiving is <code>
  System.NotSupportedException : The parameter type DbType.36 isn't supported by PostgreSQL or Npgsql</code></p>
  
  <p>Any suggestions on how to use these two libraries together for JSONB?</p>
  
  <p>Thanks.</p>