I have an SqlParameter object and I want to get the equivalent sql for the data type, e.g. varchar(50)
, int
, decimal(1, 2)
I've started looking at building it dynamically by switching on the SqlDbType
to determine if i need to use the Size property etc however this is very long-winded and error prone.
Is there a way of doing this built into the .net framework?