I am working on a class that should reduce my coding by dynamically creating and executing the command objects.

all my commands are sql stored procedures. I have a datareader that selects the parameters, datatype, and length of the value. I am trying to use these values to create the parameter objects. I am erroring out when I attempt to convert the name of the data type (varchar, datetime, bit, int) to the sqldbytype.

Is there a way I can convert the name of the value to the actual datatype?

One Idea I has was to create a function that would be a case statement, depending on the string value the datatype would be returned, but that seems clunky.

Any Ideas?