Using DBNull.Value with SqlParameter without knowing sqlDbType?

前端 未结 5 1338
有刺的猬
有刺的猬 2021-01-05 19:42

I\'m using a SqlParameter to pass in null values to a table for various columns that are nullable. The problem is that SqlParameter looks like it defaults to nv

5条回答
  •  失恋的感觉
    2021-01-05 20:20

    Set the default value of the NULL columns (to NULL) and then don't pass any NULL columns in your insert statement.

提交回复
热议问题