How to Create a Client Server Application with Database Access on Multiple Computers

YouTube video

Welcome to our channel! In this tutorial, we will show you how to create a client-server application that can be accessed by multiple computers. This tutorial consists of five main points:

  1. Establish a dynamic IP connection to the database:
  2. We will use a textbox to add the host connection to the database.
  3. This allows us to change the IP address dynamically.

  4. Allow the database to be accessed by other computers:

  5. By default, the MySQL database uses port 3306 to communicate.
  6. We will either enable access through the firewall or disable the firewall altogether.

  7. Update the firewall settings to access port 3306:

  8. We can either configure the firewall to allow access to port 3306 or disable it.

  9. Test the connection between computers:

  10. We will use the ping command to test the connectivity between different computers.

To begin, in a previous video, we demonstrated how to create, read, update, and delete data using the grid view feature. You can download the project files from our website to practice along with this tutorial.

First, let’s test the connection to the MySQL server. Ensure that MySQL and Apache services are running on your machine. The default port for MySQL is 3306.

Next, we will change the connection to support dynamic IP addresses. To do this, we will create a class called “IP Server” and add a public property for the IP address. Using a textbox, we will set the IP address in the application.

After making these changes, we need to update the data connection class to fetch the IP address from the textbox. This will allow us to connect to the database on different computers.

Now, let’s test the application on our local machine to make sure it works. We can add, update, and delete records without any issues.

To access the application from other computers, we need to modify the MySQL configuration file. By changing the bind address to 0.0.0.0, we allow access from any computer in the network.

Additionally, we may need to adjust the firewall settings to permit incoming connections to port 3306. If you prefer, you can disable the firewall altogether. However, it’s recommended to create an exception for port 3306 instead.

To test the connection between computers, we will use the ping command. Ensure that both the host and client computers are on the same network segment. You can check your IP address configurations using the ipconfig command.

Once the connection is established, we can proceed to create the setup for our client-server application. Open Visual Studio and create a new project. Use the InstallShield Limited Edition to create an installer for the application.

Add the existing project to the installer and configure the settings according to your preferences. Make sure to select the proper .NET framework version and create a desktop shortcut.

Build the solution to generate the installation files. You can now run the setup on your client computers to install the application. Once installed, you can access the application from these computers by entering the IP address or hostname of the server.

Congratulations! You have successfully created a client-server application that can be accessed by multiple computers. This allows you to share and manage data across your network easily.

In conclusion, we have learned how to create a client-server application with database access on multiple computers. By following the steps outlined in this tutorial, you can easily set up and deploy your application to different machines. Happy coding!

Keywords: client-server application, database access, dynamic IP, firewall settings, MySQL configuration, setup installation.