Visual Studio错误系统.invalidoperationException

发布于 2025-02-09 10:35:43 字数 780 浏览 1 评论 0原文

我正在尝试将我的MySQL Server与XAMMP连接到Visual Studio上的简单视觉基本形式。 这是代码

Imports MySql.Data.MySqlClient

Public Class Form1

    Private conexion As New MySqlConnection("server=127.0.0.1;database=juegos_de_la_nba1;user=root;passwords=''")
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Try

            conexion.Open()

            MsgBox("la conexion ha sido exitosa")

        Catch ex As Exception

            MsgBox(ex.Message)

        Finally

            If conexion.State = ConnectionState.Open Then

                conexion.Close()
            End If
        End Try
    End Sub
End Class

是,此错误出现在此处输入图像描述

i am trying to connect my mysql server WITH XAMMP to a simple visual basic form on visual studio.
here's the code

Imports MySql.Data.MySqlClient

Public Class Form1

    Private conexion As New MySqlConnection("server=127.0.0.1;database=juegos_de_la_nba1;user=root;passwords=''")
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Try

            conexion.Open()

            MsgBox("la conexion ha sido exitosa")

        Catch ex As Exception

            MsgBox(ex.Message)

        Finally

            If conexion.State = ConnectionState.Open Then

                conexion.Close()
            End If
        End Try
    End Sub
End Class

the thing is that this error appears enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文