copy data from datatable to dataset.datatable
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";
精彩评论