解决办法 直接修改列名 dt.Columns["Name"].ColumnName = "ShortName"; sql查询时设置别名 select ID as TableID from Users; 原博文 1.DataAdapter的SQL别名: SELECT PID AS "代码" From -- 2.填充Dataset之前进行映射,映射包括表明映射和列名映射: dataAdapter.TableMappings.Add("Tab…
Mapper类 using System; using System.Collections.Generic; using System.Data; using System.Globalization; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; namespace CommonHelper { public class Mapper { public…