T
tshad
This is similar to my previous question.
If I have a set of parameters that I won't know until runtime what the
parameter type will be, is there an easy way to do this?
For example if I have:
cmdCleaned.Parameters.Add("@" + "Zip",
SqlDbType.varchar).Value = "something";
or
cmdCleaned.Parameters.Add("@" + "amount",
SqlDbType.decimal).Value = 100.50;
I may know know what the SqlDBType is except as a string I get from the
database.
So I may have a field called dbType with a value of "int" or "datatime" or
"varchar".
Is there some easy way to handle this without a bunch of if statements?
Thanks,
Tom
If I have a set of parameters that I won't know until runtime what the
parameter type will be, is there an easy way to do this?
For example if I have:
cmdCleaned.Parameters.Add("@" + "Zip",
SqlDbType.varchar).Value = "something";
or
cmdCleaned.Parameters.Add("@" + "amount",
SqlDbType.decimal).Value = 100.50;
I may know know what the SqlDBType is except as a string I get from the
database.
So I may have a field called dbType with a value of "int" or "datatime" or
"varchar".
Is there some easy way to handle this without a bunch of if statements?
Thanks,
Tom