Sample Code For Client Server Applications Using VB 2008
Jun 4, 2009
Is there any chance who can give me a sample code for client-server applications using vb.net 2008 express edition/professional edition?
1. What SQL Server should I use? Can we use SQL Server 2000 for Client-Server application as my back end database? and will use the vb.net 2008 express edition as front end?
2. If we use these two components (SQL Server 2000 (Back-end) + (VB.Net 2008 Frontend) do you think this will works properly?
3. If this is possible by accessing via code? then please send me connection string.
4. Is there any database server we can use? asides from sql server? where we can implement client-server applications? how about oracle? MySQL Database Server?
I am looking for sample code for vb.net Dynamic Dashboard applications? i want the code in vb.net which will be my front end and sql will be my back end for database?
am new to visual basic and I would like to learn socket programming, I've seen a lot of tutorials on the intenet and they worked, but when I come to add my own code like sending a file or excute a command etc, I realize am not able to. so am requesting a tutorial with DETAILED EXPLANATION on socket programing, both server and client, I might be asking for alot, but I need it
how to create a client/server... But I couldn't... I don't want anything fancy. Just want the client to send the server 4 numbers, depending on the user's choice; after that, the server would turn off the pc, restart it, etc. It all depends on the number received. Is there a rather "simple" way to do it? If it's not to much trouble you could use Atheist's example. (Btw I don't understand the code and, yes, I've checked on [URL])
Im using the code from [URL] as a starter, most of the code is the same. the chat system works fine but on the client a added a disconnect button "clientSocket.Close()" and as soon as i click that i get errors, on the client, this is the code...
Private Sub getMessage() For infiniteCounter = 1 To 2
[CODE]...
And this line...
serverStream.Read(inStream, 0, buffSize) gives me "Unable to read data from the transport connection: A blocking operation was interrupted by a call to WSACancelBlockingCall."
Now im talking the server, after the client clicks disconnect or closes by task manager, looses connection, etc the server crashes and gives me.
Using the VB.net code from Athiest's post I have got a TCP server and client working, my problem is the Server side is too confusing and has too much functionality that I do not need. Using the below code I can get the server to send the client a message and I can have the client display that in a Message Box, I can also have the Client send the Server a message but I cannot get the server to display that text in a message box.
Hey guys, I am trying to send data from client to server (encrypted) and the string sent from the client is not the same as recieved from the server. I've been killing my brain for hours to get this to work but I cant manage. Im converting everything to Base64 string.
Client:
Public Sub SendMessage(ByVal msg As String) Try SyncLock myclient.GetStream sw = New IO.StreamWriter(myclient.GetStream)
send me sample code for SelectedIndexChanged event for Combobox , whn i change value in Combobox through SelectedIndexChanged event then data should be change in Other Combobox and Textbox.B`se i am tring a lot for this but last i am not able to get.In load Event i bind the data in Combobox control .
If All controls bind the same table then how can do code?? and if controls bind different tables then how can do code??
I have a TCP connection code for client and server communication. It's not meant to be malware but it collects the clients computer information and then connects to the server.
It successfully "connects" but then immediately disconnects.Here is the code for the server:
Dim Listener As TcpListener Dim Client As TcpClient Dim ClientList As New List(Of ChatClient) Dim sReader As StreamReader
[Code]...
I have port forwarding all done and it works if I run the client and server on my own machine. If I run the client on another machine though It gives me a message box saying that it connected with the clients remote IP and at the same time it tells me it disconnected. The client never sends the system information. What is the problem?
I am trying to code a client - server program. I have 4 winsock controls on my main form. The client is able to connect to a free one just fine, and can figure out if they are all in use. When testing my program, I found that when I try to send data through a socket, then send different data directly after, it jumbles the data together.
CODE:
That is the code I am using. When the client is connected to the server, and ready for data, it sends the packet "@Ab". When the server receives this packet, It is supposed to send the welcome alert, and then current events posted in the server.
On the client side, there is a message box that is supposed to show the welcome alert, and at the bottom on a status strip, the current events are supposed to be listed.
When the welcome alert shows, it contains the alert text fine, but then shows the packet for the events after it.
We are creating a Who wants to be a millionaire style game in VB. Our server is pulling information such as questions and answers from a Access Database and sending them to the contestants (Clients). All transfer of information is directly from the server to each client. One of the "Life Lines" we want to use is "Ask a friend", where one client is able to Instant message another client for a short time to get help on the question.
i have been working on a chat program Server side and client side i have most of the features i was asked to put in but then once i got most of the bugs out i noticed something the server admin could send whispers and alerts to single users but then when you try do do it on the client side it wont work so i looked through it all and found my issue the user list on the client is only a list of the names in server hash table so i was wondering how do i send the hashtable and all of its data E.G. user connection information to the client so that it can send commands to individual users like the server side can
vb Public clients As New Hashtable() ' This subroutine checks to see if username already exists in the clients ' Hashtable. If it does, send a REFUSE message, otherwise confirm with a JOIN.
[code]....
i tried to send the hashtable over the same method used to send the user names to the client but it cannot convert the hashtable to a string so that wont work so my question is How do i send the hash table to the user from the server then display the username on the client ??
The problem I have is: When I click on cmdListen in the server form and cmdConnect in the client form,both programs won't respond and they crash for some reason I don't know.
Client source code:
Code:
Imports System.Net.Sockets Imports System.Text Public Class Form1
[CODE]...
Code: Imports System.Net.Sockets Imports System.Text Public Class Form1
I migrated some applications from Visual Studio 2005 to Visual Studio 2010. I develope using VB.NET in VISUAL STUDIO 2010 on a Windows 7 PC (32 bit). The applications writed in VB.NET - VS2005 run correctly in PC having XP, VISTA, WINDOWS 7 and Windows Server 2008. After the migration, the exe of these applications work correctly in PC having XP, Vista, Windows 7 but work stop immediatly on Windows Server 2008. The error returned is 'System.InvalidOperationException'. Seems that the application stop when attempt to evaluate the first global variable that meets. If i change the framework from 2.0 to 3.5, things don't change.
I've basically made a basic tcp server/client application. The thing is that I'm behind a router and so will be the other people that use my clients. I've had to use port-forwarding or the software "rinetd"to run quite a few applications online.
Let me explain: I'm on a lan network that connects to the internet. Whenever I want to host a server - for instance a basic ftp or http server. If I give my external IP to anyone, they won't be able to access my server. Even if I portforward, it doesnt work. I have to use rinetd here. For other applications, portforwarding works. I'm not sure how these things work at all.
Anyway, my issue now is that I have created this server/client application. I'm having serious doubts that if I run the server, I'll have to either a) portforward or use rinetd to get people to connect to my server. IF I need to portforward, that's fine. However, using rinetd would really suck... My 2nd concern is as follows: IF the person running the client is in a similar situation as me (i.e he's on a lan that has a router which connects to the net), will he have to portforward or use rinetd as well? If he portforwards that's fine. But I don't think I could get people to use rinetd.... Also, if there are more than 1 person on a lan trying to connect to my server, there is a big problem when they try to portforward: they will only be able to allocate one of their internal ip to that port, and the others won't be able to connect, right? How does this work? I mean, I use many softwares like msn/skype/(some games)/firefox that do not need portforwarding/rinetd. Yet they work. My housemates(other people on the lan) use the same softwares, and it works fine. There's no clash/probs watsoever How come these run fine?
Anyway, back to my issues. Given I have no knowledge about how the above work, I was wondering whether there was a way to host a vb .net server application on an external website (external to my house) so that I might *avoid* the above mentioned problems, and to what extent that would be a sound solution.
i have lots of confused ideas like should you transfer files using tcp? Example: I was thinking, I connect to server from client, open file in binary, division by packet size(bytes), send first packet to server, get request if file was delivered succesfully, send next packet. If I do it this way i would need something to know/increase packet size.
I'm making a program that would require me to send data between to different machines.The way i plan to do this is to have a server program constantly running on my computer.(any other way to do this?) When someone opens the Client program, the program connects to the server. The server then takes the users I.P address and Username and adds it to a listbox on the Server application. Then the server application constantly updates the list of users on the Client application. So that way every user can see everyone that is connected.Then, when the user wants to connect to another user - They select the Username from their listbox of users. Then all connections will be handled between the users = Each user is connected to the other user's Client program. Well there is the first thing i don't know how to do.The next is simply how i send the data between the users. Would i use a winsock control?Example: One user does an action. The winsock control sends the text "blue" to the other user. The other user's program's form color changes to the color blue. That's not what this program will do, but it's just an example.
Is is possible for the server to give all clients that are connected to it a separate threading starting from 1-2-3-etc that will be display there username on a listview. Server can now connect to any of them by clicking on one of the items in the listview.
EX: Multi-Clients Connect to server ---> Server gives each one a separate thread starting with 1 ----> Client sends username to server -----> Server displays them on listview ---> Server can now double click or whatever on the item ---> Pulles up thread count and connects to it.
i write a vb code that it can do connect to serverthe question is when i connect to the server the server have receive the connected and the client exists not found serverit shows out this warning "strData' is passed by reference before it has been assigned a value. A null reference exception could result at runtime."
I have been reading through Atheists posts in regards to client-server and TCP client/server connection's. But how do i go about writing a program with 1 client and server where the client side creates a text file.Once the server sees there is a text file it connects and downloads it to itself or the client pushes the text file to the server.Once on the server i will read the text file and put its info into a sql db.
I'm not even sure where to start. I would like to create something like the ADO DataReader but that works in a TCP Client/Server scenario.Basically, in the TCP Client, I want to be able to call a certain command in the TCP Server which will return a DataReader like object, which I can then iterate through such as:
while dr.Read from the client. In each loop, I would parse out the various fields as in a normal DataReader.The reason I want to do this is to gain the inherent efficiency of the DataReader object since it doesn't first load ALL of the data. To my understanding, the typical TCP Client/Server setup using streams, would first load all of the data on the server, then transport ALL of that data to the client for processing. I want to avoid that, and just stream the data as the client requests through the Read() command which means the connection will remain open to the server while the Read() command is being issued by the client, or until explicitly closed by the client.
I am building a client-server type applications and they are communicating over sockets. This is the first time I am doing such a program and I have been learning off a web example and thought I understood it all but it would appear I am missing something as it starts to work then errors. Here is what I have:
VB Dim serverSocket As New TcpListener(ListeningPort) Dim clientSocket As TcpClient Dim netStream As NetworkStream Dim BytesFrom(1024) As Byte Dim DataFromClient As String [Code] .....
All of the above works and if I open up a telnet command window I can connect to my machine running this code on my specified port and in the command prompt window 'IDENTIFY' appears as it should from the above code. But it then gets to this block an errors on the second line:
Now as far as I can tell it shouldn't be processing the first line [ netStream = clientSocket.GetStream() ] Until I send something back from the client because then going on to the second line its trying to process something that isn't there yet.
The actual error I get is: Specified argument was out of the range of valid values. Parameter name: size On the line: netStream.Read(BytesFrom, 0, CInt(clientSocket.ReceiveBufferSize))
I would like to create a server program that accesses an "ms access" database. I will also need a client program that connects to the server. The reason for this is that the server is a mediator for several clients. Since I am using access, I plan on maybe having 20 or 30 clients connect to the server only. The client will have access to a virtual market. So when a person buys or sells something on the market, the server mediates the transaction and etc. At the same time, the access database saves each clients data as well as the overall market data.
I'm having some trouble creating a multi-client server / client thingy.So far, I've used Atheist's example and allowed the clients to successfully transmit information.However, whenever I send more than 1 message to the server at the same time, the server bugs up and does not receive the message at all. I suspect it has something to do with the DoRead method reading from both clients and stuffing it up or something.