c# - c# 显示 MySQLScript 类的警告
问题描述
我正在学习使用 MySqlScript 类,并且我认为我已经知道如何从文件中执行 MySQL 脚本,并且还知道刚刚执行了什么语句(使用 StatementExecuted 事件)。但是 MySQL 警告呢?有没有办法在脚本中显示结果或每个语句的警告?
我想显示带有相应警告/受影响行的 SQL 语句
MySqlScript script = new MySqlScript(myConexion, File.ReadAllText(openFileDialog1.FileName));
script.StatementExecuted += Script_StatementExecuted;
script.Execute();
private void Script_StatementExecuted(object sender, MySqlScriptEventArgs args)
{
MessageBox.Show(args.StatementText); // this is only a test, this will be stored in some other place not displayed as a message;
}
解决方案
推荐阅读
- python - 为什么下面的代码会产生缩进错误?
- node.js - 从 localhost node.js 服务器获取外部数据
- google-bigquery - 我可以在 BQ 表被覆盖时查询它吗?
- javascript - 如何使用云函数将数据写入云 Firestore
- python - 使用 mongodb $push 和 $pull 支持(点赞)函数
- c# - 无法激活 Windows 应用商店应用程序“不支持操作”
- java - Maven WAR 项目中静态文件的首选文件位置
- jsf - Primefaces树通过commandButtons动态添加兄弟/子
- javascript - 更新值另一个文件
- r - R - cbind 后的日期格式