Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在其他计算机上使用VB.net和MySQL导出的sql文件_Mysql_Vb.net - Fatal编程技术网

在其他计算机上使用VB.net和MySQL导出的sql文件

在其他计算机上使用VB.net和MySQL导出的sql文件,mysql,vb.net,Mysql,Vb.net,我已经用vb.net编写了代码,数据库是mysql。我已经将mysql数据库导出到了.sql文件中,并将代码构建到了应用程序中,但有一个问题,当我试图在其他计算机上运行我的应用程序时,我的应用程序没有读取导出的mysql数据库文件。有人能帮我解决这个问题吗?如果有人问我的代码,我会附加几行代码 Dim query As String Dim count As Integer sqlcon = New MySqlConnection sqlcon.ConnectionS

我已经用vb.net编写了代码,数据库是mysql。我已经将mysql数据库导出到了.sql文件中,并将代码构建到了应用程序中,但有一个问题,当我试图在其他计算机上运行我的应用程序时,我的应用程序没有读取导出的mysql数据库文件。有人能帮我解决这个问题吗?如果有人问我的代码,我会附加几行代码

 Dim query As String
    Dim count As Integer

    sqlcon = New MySqlConnection
    sqlcon.ConnectionString =
    "server=localhost;userid=root;password=root;database=svfmemberlistdb"

    Try
        sqlcon.Open()
        query = " SELECT * FROM svfmemberlistdb.account where username='" & txtUser.Text & "' and password='" & txtPass.Text & "' "
        sqlcmd = New MySqlCommand(query, sqlcon)
        sqlrdr = sqlcmd.ExecuteReader

        count = 0

        While sqlrdr.Read
            count = count + 1
        End While

        If count = 1 Then
            Me.DialogResult = DialogResult.OK
            MessageBox.Show("Login Successful")
            Me.Hide()
        ElseIf count > 1 Then
            MessageBox.Show("Username or Password are Duplicated")
        Else
            MessageBox.Show("Login Failed, Invalid Username or Password")
        End If

        sqlcon.Close()
    Catch ex As MySqlException
        MessageBox.Show(ex.Message)
    End Try
这是当我尝试在其他计算机上使用其数据库运行构建应用程序时出现的错误消息


你能展示你的代码访问你的SQLive吗?请在问题上附上几行我的代码@Gustiarya还附加了错误消息中已附加的内容@GustiAryatry将server=“localhost”更改为server=“安装数据库的IP地址”