Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'tomnoblescom.ipagemysql.com' (111) in /home/tmnobles/public_html/Subject_Directory/Visual_Basic/comments/config.php on line 15
Could not connect to MySQL
| site search by freefind |
There are multiple options available when working on a login system, but in this article we will build a login system similar to one you would find for a web site. Usernames and passwords will be stored in a MySQL table, and MySQL will handle authentication and privilege management. It can be assumed that registration has taken place on the web site and the application has been downloaded by the user. The application will act as a client program for connecting to a MySql server using user name and password and will require a remote MySql server [1]. After successful login, the program will retreive the user ID, which is the primary index for the user table.
This article will explain how to implement a user Client program (or login form) on some computer somewhere and login to a MySql database whose address you know and configuration you can control. A reference must be made to the MySql DLL (MySql.Data). MySQL Connector/Net is a fully-managed ADO.NET driver written in 100% pure C#. For more information about MySQL Connector/Net, see MySQL Connector/Net.
I have opened Visual Studio and given my project a name, "LoginToMySql". I placed two buttons, two Text Boxes with labels and a label for the status of the MySql connection. I named the buttons "Login" (to compare name & password from database) and "Cancel " (to close the form). The text boxes are named "txtUsername" and "txtPassword". The status label I named svrStatus, set its test properity as "Database Server Status", set AutoSize to "True" and set TextAlign properity to "MiddleCenter". There are several properties' you can change to add formatting and color to your form such as the medical staff icon I added to this form.