Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. how a dataset can transfer from server to client using socket programming in C#

how a dataset can transfer from server to client using socket programming in C#

Scheduled Pinned Locked Moved C#
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    abhishek29
    wrote on last edited by
    #1

    how a dataset can transfer from server to client using socket programming in C#. Is it possible?

    0 1 Reply Last reply
    0
    • A abhishek29

      how a dataset can transfer from server to client using socket programming in C#. Is it possible?

      0 Offline
      0 Offline
      0x3c0
      wrote on last edited by
      #2

      Create a NetworkStream between the two computers and serialise the DataSet across it. Use a CryptoStream if you need security

      A 1 Reply Last reply
      0
      • 0 0x3c0

        Create a NetworkStream between the two computers and serialise the DataSet across it. Use a CryptoStream if you need security

        A Offline
        A Offline
        abhishek29
        wrote on last edited by
        #3

        Please send some example code related to this.

        A 0 2 Replies Last reply
        0
        • A abhishek29

          Please send some example code related to this.

          A Offline
          A Offline
          agent00zelda
          wrote on last edited by
          #4

          http://msdn.microsoft.com/en-us/library/system.net.sockets.networkstream.aspx

          1 Reply Last reply
          0
          • A abhishek29

            Please send some example code related to this.

            0 Offline
            0 Offline
            0x3c0
            wrote on last edited by
            #5

            If I do that, you won't learn from it. The most that you will get out of me is some pseudo-code Client Start listening on port x Set up a background thread. When you receive data, use TcpClient.GetStream to get the NetworkStream Deserialise the NetworkStream into a DataSet Close the NetworkStream and TcpClient Server Accept an IP address Try to connect to the IP address, on port x (this is the same port as the client) When you have connected, simply use the same TcpClient.GetStream method as a data sink. Serialise the DataSet into this Stream Close the NetworkStream and TcpClient If you really wanted to, you could make this more complex (status codes, etc), but that's the basic gist of it. If you need code, then search Google for a simple chat application (this gets you the basic infrastructure) and serialisation (this will cover the transfer of the DataSet)

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups