I have a DataTable obtained from a SQL DataBase, like this:
using (SqlCommand cmd = new SqlCommand(query, _sqlserverDB))
{
using (SqlDataAdapter adapter
You cannot because System.Data.DataTable
(or DataColumn
, or DataSet
, or DataRow
...) is a generic .NET data container which works the same way regardless on the specific database engine you loaded your data from.
this means that provided you used a .NET Connector for SQL Server, MySQL, Access, PostgreSQL or anything else, the DataTable
and DataColumn
classes are always the same and being ADO.NET objects are generic to work with any db engine, so the columns are typed with the .NET types as you have found out.