如何使用mysql登录到wamp数据库 [英] how to login to wamp database using mysql

查看:207
本文介绍了如何使用mysql登录到wamp数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我完成所有mysql连接后需要帮助如何登录数据库wamp

hello all, need help how to login to database wamp after i doing all mysql connection

Imports System
Imports System.Data
Imports MySql.Data.MySqlClient
Public Class Form1
    Dim con As MySqlConnection = New MySqlConnection("Server=localhost;Database=newdb;Uid=root;Pwd=;")
    

    Private Sub cmdenter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdenter.Click
        Dim sqlquery = "select * from user"
        Dim command As New MySqlCommand
        command.Connection = con
        command.CommandText = sqlquery
        Dim data As New MySqlDataAdapter



        Dim ds As DataSet = New DataSet()
        Dim dataAdapter1 As MySqlDataAdapter = New MySqlDataAdapter
        Try
            con.Open()
            MessageBox.Show("Connection Opened Successfully")
            con.Close()
        Catch myerror As MySqlException
            MessageBox.Show("Error Connecting to Database: " & myerror.Message)
        Finally
            con.Dispose()
        End Try


        If TextBox1.Text = sqlquery And TextBox2.Text = sqlquery Then

            Form7.Show() 'Shows the Login Success Form
            Form2.Show()
            Me.Hide()       'Hides the Login Screen

        Else

            'A Message box that displays you have entered the wrong username and password

            MsgBox("You have entered the wrong username and password", MsgBoxStyle.Information, "login error")
        End If
      

    End Sub

推荐答案

您的查询有误,请阅读以下内容:
http://www.dreamincode.net/forums /topic/11117-login-login-form-with-vbnet-how-to-verify/ [ http://www.daniweb.com/software-development/vbnet/threads/81418 [ ^ ]
Your query is wrong, read these :
http://www.dreamincode.net/forums/topic/11117-login-login-form-with-vbnet-how-to-verify/[^]

http://www.daniweb.com/software-development/vbnet/threads/81418[^]


这篇关于如何使用mysql登录到wamp数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆