tailieunhanh - Updating Server Data Using .NET Remoting

Updating Server Data Using .NET Remoting Problem You want to update a data source using .NET remoting and use the remote application from your client application. Solution Use to create a remoteable class. | Team LiB Recipe Updating Server Data Using .NET Remoting Problem You want to update a data source using .NET remoting and use the remote application from your client application. Solution Use to create a remoteable class. The server-side code that registers the remoteable class for remote activation contains one event handler and one configuration file Start Server Registers the remoteable class RemoteClass for remote activation. Server-side configuration file Contains parameters used to register the class and the channel on the server so that the class can be activated from another application domain. The remoteable class code contains two methods LoadOrders Creates and returns a DataSet containing the Orders and Order Details tables from Northwind and a DataRelation between those tables. UpdateOrders Takes a DataSet argument containing the changes made to the DataSet created by the LoadOrders method creates two DataAdapter objects with CommandBuilder-generated update logic for each and uses the DataAdapter objects to update the Orders and Order Details tables in Northwind. The client-side code contains two event handlers and one configuration file Sets up the example by calling the LoadOrders method in the remote object to populate a DataSet. The default view of the Orders table is bound to the data grid on the form. Update Calls the UpdateOrders method in the remote object passing a DataSet containing changes made to the DataSet since the form was loaded or since the last time the UpdateOrders method was called. Client-side configuration file Contains parameters used to register the remote class and channel on the client so that the remote class can be instantiated by the client. The C server-side code that registers the remoteable class for activation is shown in Example 4-27. Example 4-27. File NorthwindServerCS Namespaces variables and constants using System using .