dcChehao = new DataColumn("newColumnName", typeof(string));
dcChehao.Expression = "columnName1+columnName2";
dt.Columns.Add(dcChehao);
Oracle:
select col1||col2 from table
sql server:
select col1+col2 from table
dcChehao.Expression = "columnName1+columnName2";
dt.Columns.Add(dcChehao);
Oracle:
select col1||col2 from table
sql server:
select col1+col2 from table
本文介绍了一种在不同数据库中实现字段拼接的方法。通过示例展示了如何在.NET框架下使用C#语言创建新的数据列,并设置其表达式为两个现有字段的组合。此外,还提供了Oracle和SQL Server中实现字符串拼接的SQL语句。
3066

被折叠的 条评论
为什么被折叠?



