You can get the column data type of the data table easily. There are just two lines of code, that will help you find the data type.
/* dt is the object of datatable . */
System.Type type = dt.Rows[0][1].GetType();
if (type == typeof(string)){
dt.Rows[0][1] = "Data type is string";
}

Arpit TrivediPosted Mar 28, 2017, 7:31 AM
You can get column type of DataTable with *DataType* attribute of datatable column like below: var type = dt.Columns[0].DataType dt : DataTable object. 0 : DataTable column index. Hope It Helps Ty :)