Converting from Type to SqlDbType

StackOverflow user Simone Salvo asked how to do
a smart conversion between .Net and , which
is not really a trivial task. For my answer, I wrote the following somewhat naïve code: Caveat The above code works fine in most cases, but comes with so…