none
data transfer thru gprs in vb.net

    Question

  • hi,

     can any one tell me how to transfer data through gprs to a oracle server using vb .net

    i am using this coding below

     

    IPHostEntry ServerEntry;
                TcpClient Client = new TcpClient();
                Stream SocketStream;
                Byte[] InputData = new Byte[256];
                
                try
                {
                                   ServerEntry = Dns.GetHostEntry("169.254.2.2");
     

                }
                catch (SocketException SExp)
                {
                    if (SExp.ErrorCode == 11001) // No such host is known
                    {
                                            Console.WriteLine("Server Not Known");
                        Console.WriteLine(SExp.Message);
                    }
                    else
                    {
                                            Console.WriteLine("DNS Entry is not valid");
                        Console.WriteLine(SExp.Message);
                    }
                    return;

                }
                
                try
                {
                    Client.Connect("169., Convert.ToInt32(ConfigurationReader.GetFileValue("PortNumber")));
                    SocketStream = Client.GetStream();
                    InputData = Encoding.ASCII.GetBytes(ConfigurationReader.GetFileValue("Message").ToCharArray());
                    SocketStream.Write(InputData, 0, InputData.Length);
                    SocketStream.Flush();
                }
                catch (Exception WriteExcp)
                {
                  Console.WriteLine(WriteExcp.Message);
                    
                    return;
                }
                bool ServerFlag = true;
                while (ServerFlag)
                {
                    if (true == Client.GetStream().DataAvailable)
                    {
                        Client.GetStream().Read(InputData, 0, InputData.Length);
                        SocketStream.Flush();
                        Console.WriteLine(Encoding.ASCII.GetString(InputData,0,InputData.Length));
                                           ServerFlag = false;
                    }
                }
            }

    advance thanks

    Wednesday, June 01, 2011 8:43 AM

All replies