开发者

copy data from datatable to dataset.datatable

开发者 https://www.devze.com 2023-01-23 00:28 出处:网络
how to copy data from datatable to table in dataset i ry this but its readon开发者_开发问答ly property

how to copy data from datatable to table in dataset i ry this but its readon开发者_开发问答ly property

ds.datatable1=newdt.copy


if datatable1 is a pre-existing datatable in your code and you want to fill it from another datatable newdt, then just doing datatable1 = newdt.copy should suffice.

Remove the ds.from your code. If you already have a reference to the datatable in your dataset i.e. dataTable1, then you can just copy into it directly as above


DataTable newdt = ds.datatable1;

newdt = Fill Datatable form DB;

ds.datatable1.TableName = "datatable1";
0

精彩评论

暂无评论...
验证码 换一张
取 消