Hi everybody,
I made a few searches in StackOverflow but I haven't found a good clean solution yet.
The problem - I need to know the SqlDbType of the column (not its .NET type).
We have our own code which I don't like and which returns incorrect results (it returns NVarchar type (when checking String type)) but we only have Varchar type in our database.
So, I am wondering if you have a clean bullet proof code that returns SqlDbType when you pass column name (as a String) and a table name (as a String) (in our case we don't need to pass schema as we use dbo only).
Thanks a lot in advance.
----------------
The solution I looked at StackOverlow is
http://stackoverflow.com/questions/7470258/how-to-get-the-sqltype-of-a-column-in-a-datatable (and the link from it)
If it's not broken, fix it until it is.
My Blog