Creating a DataSet from another DataSet
I have a client-server project (a small project for companies in C #) and the server has a DataSet with some tables (no database for some reason, so we save the DataSet as an XML file).
when clients connect to the server, the server has to send some information to the client, depends on its privileges, and some clients have to add or remove from the DataSet on the server.
I'm going to create a new small DataSet and send it to the client (as xml), but I don't know how to create a new DataSet with specific tables and rows (I tried to use Linq for the DataSet but nothing worked). <br / ">
My questions are: how can I do this and is it a good solution for sending information to clients? can you suggest a better scenario for sending data to clients (I mean instead of creating a new DataSet).
a source to share
Load the DataSet and save it to a new name. This is your new dataset. Then you can download it separately.
Once you've done that, we'll assume the new dataset is called ds. You can use ds.Tables.Remove (string) to remove entire tables and ds.Tables [string] .Columns.Remove (string) to remove individual columns. After removing the table items that you don't need, you can remove the datarows with ds.Tables [string] .Rows.Remove (int).
a source to share
If you are sending data to users to analyze, view, send reports ... then you should use Excel or CSV as output. There are several ways to send data back to the user, which will open directly in Excel, the one I currently use the most, but NPOI . When I started using NPOI, I found many examples when moving from DataTable to Excel. NPOI also supports multiple sheets if you choose to output the DataSet to Excel.
a source to share