新列名称添加到具有相同colmn名称的数据表 [英] new column name add to a datatable with same colmn name

查看:55
本文介绍了新列名称添加到具有相同colmn名称的数据表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在c#.net中为具有相同列名的数据表添加新列。

how to add a new column to a datatable with same column name in c#.net.

推荐答案

您不能 - DataTable.Columns集合需要所有列名称必须是唯一的。您可以添加具有不同名称但相同标题文本的列,或者使用大写和小写字符的不同混合,但名称必须是唯一的 - 否则无法确定您的意思!
You can''t - a DataTable.Columns collection requires that all column Names must be unique. You can add a column with a different name but the same header text, or with a different mixture of upper and lower case characters, but the Name must be unique - otherwise it can''t determine which one you mean!


这篇关于新列名称添加到具有相同colmn名称的数据表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆