473,385 Members | 1,780 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

VB.NET Winsock Client/Server Data sending Problem

Hello All:
I am developing a client/server application using vb.net winsock programming.
I am sending data to Server and at the same time receive the incoming data from the server.
My application have 3 Windows Forms.
1-FrmInquiry
2-FrmSale
3-FrmBalance
When i send and receive data from FrmInquiry to server it works fine but
My problem is when i go to any other form(ex FrmSale) from FrmInquiry and send data from it to server, it gives error.
but When i run the form FrmSale directly it works fine.
I tried it through Closing socket at Form Unload and initialize its port and IP settings again but no luck.any suggestion?
Another thing is when i close the server & client application and then run it again the FrmInquiry form send data successfully
but again it gives error when i goto FrmSale Form.
How can i send data from one form to another
My code is:

//code for FrmInquiry Form in Load event
tcpclient.remoteport=3000
tcpclient.remotehost="192.168.0.10"
tcpclient.connect
tcpclient.senddata("salman")
dim obj as new FrmSale
obj.show
me.hide

//Code for FrmSale Form in Load event
tcpclient.remoteport=3000
tcpclient.remotehost="192.168.0.10"
tcpclient.connect
tcpclient.senddata("salman")
dim obj as new FrmSale
obj.show
me.hide

//code for frmServer Form in Load event
tcpserver.localport=3000
tcpserver.listen

//Accept connection request
//Get incomng request from client

Regards:
Danish Majid
May 25 '07 #1
0 1849

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Dan | last post by:
I'm writing a simplistic telnet client in VB6 and I've run into a small snag. The program has a textbox to write in the string to be sent using ..SendData and has another textbox that displays...
15
by: Michael Rybak | last post by:
hi, everyone. I'm writing a 2-players game that should support network mode. I'm now testing it on 1 PC since I don't have 2. I directly use sockets, and both client and server do...
1
by: Dom | last post by:
I'm new to c++. Just started learning it 24 hours ago. Am running into a compile problem. Please, no one waste the effort telling me to google it. I've been researching it for quite a while with no...
1
by: Nicolas Ghesquiere | last post by:
Hello I have a problem with my current program. The meaning of the program is to allow users to login to a server to allow them to access the internet. My program communicates with a MS isa...
0
by: CharChabil | last post by:
Hey Guys Using Winsock application under vb.net 2005 Using same client, i want to connect to many remote servers the Exception that i m facing : "cant not send data while not connected" i...
5
by: ekosuhanto | last post by:
any body to help me to handle the winsock server hang when the server was sending and receiving after running for 1 - 2 hours. I am using VB (not VB.net). The server will send the data from Comm...
1
by: raj.rr7 | last post by:
Hi, I am creating a Http client application using winsock, evc++ 4.0 and K- Jam (WIndows Mobile 5) that will get data from Http server. I am using the following code. WSADATA wsaData;...
1
by: danishce | last post by:
I am developing a client/server application using vb.net winsock programming. I am sending data to Server and at the same time receive the incoming data from the server. Everything works fine but...
3
AaronL
by: AaronL | last post by:
Hello, I am currently working on a project that has me in sort of a bind. What I want to do is retrieve web pages from the internet, and strip them down to just text. I'll get using Regular...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.