How to get the SqlType of a column in a DataTable?
问题 I have a DataTable obtained from a SQL DataBase, like this: using (SqlCommand cmd = new SqlCommand(query, _sqlserverDB)) { using (SqlDataAdapter adapter = new SqlDataAdapter(cmd)) { DataSet dataSet = new DataSet(); adapter.Fill(dataSet); result = (dataSet != null && dataSet.Tables != null && dataSet.Tables.Count > 0) ? dataSet.Tables[0] : null; } } When I try to get the DataType of each column through dataColumn.DataType , I get the C# types (Int32, Int64, String, etc). QUESTION: How can I