I have a client-server project (small project for companies in C#) and the server has a DataSet with some tables (there is no Database for some reasons so we save the DataSet as an XML file).
when the clients connect to the server, the server should send some informations to the client depends on his privileges and some clients must add to or Delete from the DataSet in the server.
I am thinking in Making a new small DataSet and sending it to the client (as xml) but I don’t know how to generate a new DataSet with specific tables and rows (I tried to use Linq to DataSet but nothing worked).
My Questions is how can I do that and is this a good solution to send informations to clients ? can you suggest a better scenario to send data to clients(I mean instead of making a new DataSet).
Load the DataSet and then save it to a new name. This is your new dataset. You can then load it seperately.
Once you’ve done that, we’ll assume that the new dataset is called ds. You can use ds.Tables.Remove(string) to drop whole tables, and ds.Tables[string].Columns.Remove(string) to remove individual columns. Once you’ve removed the table elements you don’t want, you can remove datarows with ds.Tables[string].Rows.Remove(int).