vb.net - DataTable belongs to another Data set / Saves extra Entries in XML -
i know question has been asked , answered here. ds.tables.add(dt.copy) ds.tables(0).tablename = "items" ds.writexml("inventory.xml") dt.copy resolve "datatable belongs data set" message when save, of course screws xml file , saves entries in file, when data grid loads xml file shows entries weren't there before. here's code. try dt = new datatable() dim ds new dataset 'dtcopy = dt.copy() dt.columns.add(new datacolumn("product_name", type.gettype("system.string"))) dt.columns.add(new datacolumn("product_sku", type.gettype("system.string"))) dt.columns.add(new datacolumn("product_price", type.gettype("system.decimal"))) dt.columns.add(new datacolumn("product_quantity", type.gettype("system.int32"))) dim integer = pinventory.rows.count = - 1 each prow in pinventory.rows if <> 0 or > 0