in Search
     
Latest post 04-15-2008 6:25 PM by DexterZ++. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 04-10-2008 10:08 PM

    • romcab
    • Top 25 Contributor
    • Joined on 11-21-2006
    • Posts 83
    • Points 1,560

    How to send dataset through network

    Hi guys,

    I have a simple client/server apps created in C#. The server apps is connected to a database server. What I want to do is that when the client connect to the server, the server will send the database content to the client. The client will then display the content on the screen. What I can think right now is to convert database contents to xml then send the xml to the network but I'm not sure if it will work. Hope you can give me any suggestion and links so I can easily understand. 

    • Post Points: 20
  • 04-11-2008 12:32 AM In reply to

    • LaTtEX
    • Top 25 Contributor
    • Joined on 02-19-2006
    • Bonifacio Global City
    • Posts 87
    • Points 1,220

    Re: How to send dataset through network

    I dunno why you have to do that. Even if a database server is across the globe, .NET will receive the data automatically without need for XML serialization.

    If you are using remoting, or web services, XML serialization is automatic as long as your data is in the form of serializable objects

    Paano ba ang setup ng app mo? 

    Jon Limjap tech :: DotNet @ Kape ni LaTtEX personal :: Kape ni LaTtEX our business: I-NAV Travel & Tours
    • Post Points: 35
  • 04-11-2008 1:28 AM In reply to

    • cruizer
    • Top 10 Contributor
    • Joined on 12-14-2005
    • Singapore
    • Posts 944
    • Points 22,590

    Re: How to send dataset through network

    i'd rather not use a dataset for this...heavy!

    http://devpinoy.org/blogs/cruizer
    Naglalayong buksan at palayain ang kamalayan ng Pinoy .NET developer
    • Post Points: 5
  • 04-13-2008 7:26 PM In reply to

    • romcab
    • Top 25 Contributor
    • Joined on 11-21-2006
    • Posts 83
    • Points 1,560

    Re: How to send dataset through network

     Hi. I'm not using remoting or web services. The requirement is just, when the client connect to the server, the server just needs to send the content of the database. The client will then display it on the screen. Do I need to use remoting or web services for that? Hope you can give me a good idea, i'm just a beginner in C# and database. Thanks again.

    • Post Points: 20
  • 04-13-2008 8:04 PM In reply to

    • LaTtEX
    • Top 25 Contributor
    • Joined on 02-19-2006
    • Bonifacio Global City
    • Posts 87
    • Points 1,220

    Re: How to send dataset through network

    No need. Just as long as you can connect remotely to your database, you can use that for your application as is. No need to serialize/deserialize into XML.
    Jon Limjap tech :: DotNet @ Kape ni LaTtEX personal :: Kape ni LaTtEX our business: I-NAV Travel & Tours
    • Post Points: 20
  • 04-13-2008 9:18 PM In reply to

    • romcab
    • Top 25 Contributor
    • Joined on 11-21-2006
    • Posts 83
    • Points 1,560

    Re: How to send dataset through network

     Hi pal,

    I think I cannot remotely connect to the database since it is local only to the server apps. That's why I need to find a way on how to send the content from server to client. 

    • Post Points: 20
  • 04-14-2008 10:45 PM In reply to

    • cruizer
    • Top 10 Contributor
    • Joined on 12-14-2005
    • Singapore
    • Posts 944
    • Points 22,590

    Re: How to send dataset through network

    easiest way to do this is via ASP.NET web services, or WCF (for .NET 3.0 and newer)

    http://devpinoy.org/blogs/cruizer
    Naglalayong buksan at palayain ang kamalayan ng Pinoy .NET developer
    • Post Points: 20
  • 04-15-2008 4:17 PM In reply to

    • romcab
    • Top 25 Contributor
    • Joined on 11-21-2006
    • Posts 83
    • Points 1,560

    Re: How to send dataset through network

     Hi,

    Right now I have an idea to solve this problem. My new problem right now is how to create a manager which handles all the connection. I need to save the thread i and ip address of the client who will connect to the server. I have no idea how to get the client IP address using Tcpclient and TcpListener class. Is there a class that I can use to do that? 

    • Post Points: 20
  • 04-15-2008 6:25 PM In reply to

    • DexterZ++
    • Top 50 Contributor
    • Joined on 12-12-2006
    • Kernel32
    • Posts 60
    • Points 915

    Re: How to send dataset through network

     
    I dont have any idea how did you implement your listener or acceptor, but
    whether you are using a seperate thread to accept connection by invoking
    _TcpListener.AcceptSocket(...) or calling an asyncronous callback by
    invoking _TcpListener.BeginAcceptSocket(...) both methods returns new
    client connecting socket.


    For thread:

        m_NewClienConnectiontSocket   = _TcpListener.AcceptSocket();

        // yourClientManager.AddClient( m_NewClientConnectionSocket );
        
        
        
    For async callback:

        m_NewClientConnectionSocket   = _TcpListener.EndAcceptSocket( result );
        
        // yourClientManager.AddClient( m_NewClientConnectionSocket );
        


    Just push m_NewClientConnectionSocket to your client manager list or collection and
    you can send and receive data from that client. Wink


    http://dexterz.spaces.live.com/     |    http://projectzgdk.spaces.live.com/

     

    • Post Points: 5
Page 1 of 1 (9 items)