mysql - VB.NET | MySQL : A fatal error encountered during command executation

标签 mysql vb.net

我很绝望,因为我的代码中存在 mysql 错误,而且我没有找到任何有用的答案。

代码:

cn.ConnectionString = "Server=" & host.Text & ";User Id=" & user.Text & ";Password=" & password.Text & ";Database=" & database.Text & ";"
    cmd.Connection = cn
    Try
        cn.Open()
        cmd.CommandText = "LOAD DATA LOCAL INFILE '" & directory.Text & "' INTO TABLE " & database.Text & "." & table.Text & ";"
        MsgBox(cmd.CommandText)
        dr = cmd.ExecuteReader
    Catch exError As MySqlException
        MsgBox("Error: " & exError.Message, MsgBoxStyle.Critical)
    End Try
    cn.Close()

错误截图: http://i.imgur.com/gkEsspQ.png

编辑:错误的屏幕截图 2(更详细):http://i.imgur.com/iyOsAxr.png

当我使用这一行时:

cmd.CommandText = "LOAD DATA LOCAL INFILE 'D:/Bibliothek/Desktop/test.txt' INTO TABLE test.test; 

它有效。

最佳答案

我认为这就是问题所在。

When you use VB.Net values in MySQL query Remember to start like this '" and end like this "'

'" textbox1.text "'

关于mysql - VB.NET | MySQL : A fatal error encountered during command executation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38803576/

相关文章:

mysql - 调试套件显示重复的查询

java - 使用java备份mysql数据库

c++ - 我可以将VB代码转换为C++代码吗

.net - Entity Framework 4 保存并取消

c# - 如何从 C# 内置的应用程序检测安装并自动启动 MySQL 服务器

php - 如何在 PHP 中使用 shell_script 创建数据库后创建表?

mysql - SELECT 的结果到新表中

c# - 什么是NullReferenceException,如何解决?

.net - .NET 的 FIPS 兼容密码加密

vb.net - vb 计数奇怪的行为