send type as argument c#

C#
object GetColumnValue(string columnName, Type type)
{
    // Here, you can check specific types, as needed:

    if (type == typeof(int)) { // ...T GetColumnValue<T>(string columnName)
{
    // If you need the type, you can use typeof(T)...
Source

Also in C#: