This only works if you are creating DbCommand from the GetStoredProcCommand method.
If you use the GetSqlStringCommand method, you need to provide the SqlParameter.TypeName. However, EntLib 4.1 is not updated to support the new Sql Server 2008 datatypes. The AddInParameter+AddParameter overloads do not
allow you to pass in the TypeName. It would be nice if there was an AddParameter overload that accepts just SqlParameter.
(I'm using GetSqlStringCommand because I am calling a scalar UDF. The workaround is to wrap the UDF inside a SP.)
My guess is as to why you don't need to specify the SqlParameter.TypeName when using the GetStoredProcCommand is during the SP compilation, it resolves all the types used. Meanwhile, GetSqlStringCommand causes an ad-hoc compilation and it needs help to determine
what is the specific table type (as there can be more than one).