using System.Data.SqlClient;
public static void Main()
Func<Object, SqlDbType> getSqlType = val => new SqlParameter("Test", val).SqlDbType;
Func<Type, SqlDbType> getSqlType2 = type => new SqlParameter("Test", type.IsValueType ? Activator.CreateInstance(type) : null).SqlDbType;
Object obj = "valueToTest";
getSqlType2(typeof (String)).Dump();
getSqlType2(typeof (Int32)).Dump();
getSqlType2(typeof (Int64)).Dump();