View Poll Results: Did this help u?

Voters
6. You may not vote on this poll
  • Yes

    5 83.33%
  • No

    1 16.67%
Results 1 to 5 of 5

Thread: Make a free online database + Make a VB.NET login form to connect to this database

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2010
    Posts
    137

    Exclamation Make a free online database + Make a VB.NET login form to connect to this database

    Hello everybody I posted this tutorial because i wanted to learn this before but i can't find the solution on any site or forum.
    This will teach you
    1.to make a MySQL Database for free
    2.Make a login form for your program so no one can use this program except users on the database
    Watch this video to know how:
    http://searchico.x10.mx/DB2.html

    Here is the source code:

    Code:
    Imports System.Data.SqlClient
    Imports MySql.Data.MySqlClient
    Public Class LoginForm1
        Dim MySQLConnection As MySqlConnection
        Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
            Me.Close()
        End Sub
    
        Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
            Me.Close()
        End Sub
    
        Private Sub Cancel_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click
            End
        End Sub
    Private Sub OK_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
            MySQLConnection = New MySqlConnection
            MySQLConnection.ConnectionString = "server=db4free.net;Port=3306; User ID=db4freeusername; password=db4freepassword; database=nameofyourdatabase"
            MySQLConnection.Open()
    
            Dim MyAdapter As New MySqlDataAdapter
            Dim SqlQuary = "SELECT * From nameofthetable WHERE Username='" & UsernameTextBox.Text & "' AND password = '" & PasswordTextBox.Text & "';"
            Dim Command As New MySqlCommand
            Command.Connection = MySQLConnection
            Command.CommandText = SqlQuary
            MyAdapter.SelectCommand = Command
            Dim Mydata As MySqlDataReader
            Mydata = Command.ExecuteReader
            If Mydata.HasRows = 0 Then
                MsgBox("Error During Login:Please Enter Valid Data")
            Else
                Form1.Show()
                Me.Hide()
            End If
        End Sub
    End Class

    Hope that this helped
    Please stick my topic
    Last edited by salmawy; Sep 15th, 2010 at 11:33 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width