Is there a better way to code this example?

Ingeborg Conrad Oscar 26 Reputation points
2021-06-20T18:33:55.73+00:00

this code i got from a youtube tutorial and the person explains how the server and client are communicating, but how can i get the information from the server to the clinent.

What line of code does get the information?

107290-whatsapp-image-2021-06-20-at-193526-6.jpeg107353-whatsapp-image-2021-06-20-at-193526-5.jpeg107354-whatsapp-image-2021-06-20-at-193526-4.jpeg107305-whatsapp-image-2021-06-20-at-193526-3.jpeg107349-whatsapp-image-2021-06-20-at-193526-2.jpeg107298-whatsapp-image-2021-06-20-at-193526-1.jpeg107381-whatsapp-image-2021-06-20-at-193526.jpeg

Developer technologies | C#
{count} votes

Accepted answer
  1. Alberto Poblacion 1,571 Reputation points
    2021-06-21T06:14:15.053+00:00

    What line of code does get the information?

    Well, the key is in the two lines that you have in LoadServer_Click. First, you call Activator.GetObject to create an instance of the method in the remote server. And then you do ds=dss.GetDataSet(), which execute on said instance the method that obtains the data.

    This will work, but as someone already commented it is considered obsolete nowadays. If you are looking at this for some new software that you are going to develop (as opposed to learning how it works for the purpose of maintaining a legacy application) then you should consider other more modern options, such as a REST service or at the very least WCF, but not .Net Remoting.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Ingeborg Conrad Oscar 26 Reputation points
    2021-06-21T12:13:25.267+00:00
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.