+ 1

I need code for log in form using visual basic

26th Apr 2017, 7:19 AM
Trinugh
Trinugh - avatar
2 Respuestas
+ 3
Since you tagged 'database', I'm assuming you are going to check for users in a database (and that the database is MySQL). What you first need to do is install a MySQL-plugin to visual studio. Just google 'Visual studio mySQL reference'. After you've downloaded it, go to your project, click on 'Project' --> 'Add reference' --> and the add the file that you downloaded and installed (called something like 'mySQL.ddl'. In you form, write at the very top of your program 'Imports MySql.data.MySqlClient' This will import the library that you need. After that, you will need to define a connection to the database. You could write 'Dim connection = new MySqlConnection("Server=yourservername;Database=yourdatabasename;Uid=Yourloginname;Pwd=yourpassword;") Next, you want to use a try-catch function. Now you want to define a sql query which gets all the users which is equal to the username and password that the user types in. I can't help you much further, since i don't know your database table names and such. Get back to me about which type of database you are using and how far you've come with the project and i'll help you out!
26th Apr 2017, 8:13 AM
Roolin
Roolin - avatar
+ 1
thanks!
27th Apr 2017, 11:31 PM
Trinugh
Trinugh - avatar