且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

数据表或数据集

更新时间:2023-02-14 11:45:13

已填充数据表不会在模式中进行更改.

但是您可以执行以下操作:
1.制作一个新的数据表

2.使用datatable的Clone方法创建具有相同结构的数据表并对该列进行更改.

3,最后使用datatable的ImportRow方法向其中填充数据.

希望这对您有所帮助:)
Filled Datatables do not entertain a change in the schema.

But you can do this:
1.Make a new datatable

2.Use datatable''s Clone method to create the datatable with the same structure and make changes to that column.

3.In the end use datatable''s ImportRow method to populate it with data.

hope this helps :)


在这里您

如何在.NET/C#中更改数据列类型 [ ^ ]
Here you go

How to change a datacolumn type in .NET/C#[^]