Ventuz-MySQL8.0数据连接操作说明
方法介绍
Ventuz连接数据库有两种方法:
第一种:采用database节点连接query查询
第二种:写c#脚本连接

  • 方法一:

前期准备
工具:ventuz designer5 MySQL8.0
设置节点:

图1-1 ventuz节点图
C#脚本
双击c#脚本节点,设置input output
Input:点击+号键添加Method1 和reset方法
Output:点击+号键添加String1变量用于输出数据库值(方法数量、方法体及变量类型根据需要设定)

图1-2 input设置
脚本代码:

using System;  - using Ventuz.Kernel;  - using System.Data.Odbc;  - using System.Data;  -   - public class Script : ScriptBase, System.IDisposable  - {  -     // This member is used by the Validate() method to indicate  -     // whether the Generate() method should return true or false  -     // during its next execution.  -     private bool changed;  -       -     // This Method is called if the component is loaded/created.  -     public Script()  -     {  -         // Note: Accessing input or output properties from this method  -         // will have no effect as they have not been allocated yet.  -     }  -       -     // This Method is called if the component is unloaded/disposed  -     public virtual void Dispose()  -     {  -     }  -       -     // This Method is called if an input property has changed its value  -     public override void Validate()  -     {  -         // Remember: set changed to true if any of the output   -         // properties has been changed, see Generate()  -     }  -       -     // This Method is called every time before a frame is rendered.  -     // Return value: if true, Ventuz will notify all nodes bound to this  -     //               script node that one of the script's outputs has a  -     //               new value and they therefore need to validate. For  -     //               performance reasons, only return true if output  -     //               values really have been changed.  -     public override bool Generate()  -     {  -         changed = true;  -         return true;  -     }  -       -     // This Method is called if the function/method Method1 is invoked by the user or a bound event.  -     // Return true, if this component has to be revalidated!  -     public bool OnMethod1(int arg)  -     {     -         String1 = "";  -         string strconn = "DRIVER={MySQL ODBC 8.0 Unicode Driver};SERVER=localhost;DATABASE=databaseName;USER=userName;PASSWORD=password;OPTION=3;";  -         string sql = "select name from table";   -         OdbcConnection con = new OdbcConnection(strconn);  //建立连接对象  -         con.Open();  -         OdbcCommand com = new OdbcCommand(sql, con);    //执行查询语句赋值给com对象  -         OdbcDataReader reader = com.ExecuteReader();  -         //读到数据时写入String1  -         while (reader.Read())                        -         {  -             String1 += reader[0].ToString() + " ";  -         }  -         con.Close();  -         return true;  -     }  -       -     // This Method is called if the function/method reset is invoked by the user or a bound event.  -     // Return true, if this component has to be revalidated!  -     public bool Onreset(int arg)  -     {  -         String1 = "";  -         return false;  -     } - }

执行
点击图示方法即可显示数据库内容

图1-3 执行结果

  • 方法二

前期准备
设置节点:

图2-1 ventuz节点图
连接字符串:可以查询官网:https://www.connectionstrings.com/
我的数据库版本是mysql8.0 采用ODBC连接

图2-2 odbc数据源设置

附我的ConnectionString供参考:

DRIVER={MySQL ODBC 8.0 Unicode Driver};SERVER=localhost; DATABASE=databaseName; USER=userName; PASSWORD=password;OPTION=3;

细节操作
Query节点
Query节点用于书写sql语句,点击执行即可查看输出结果

图2-3 query节点设置
Row节点
Ventuz通过query节点输出dataset,row节点就用来显示dataset

图2-4 row节点input设置
要实现数据绑定,要选择output的数据类型并设置数据名称,要与数据库定义对应

图2-5 row节点output设置

ventuz连接mysql8.0操作相关推荐

  1. mysql8连接java_JAVA连接MYSQL8.0问题

    title: java连接mysql8.0问题 date: 2018-07-08 19:27:38 updated: tags: description: keywords: comments: im ...

  2. Navicat连接MySQL8.0版本时出现Client does not support authentication protocol requested by server;报错的问题解决办法

    Windown系统下 遇到 Navicat连接MySQL8.0版本时出现Client does not support authentication protocol requested by ser ...

  3. 七.【Python3.8+Django3.0从零开始系列】Django3.0+Python3.8连接MySql8.0及遇到的问题解决

    目录 一.Django3.0连接MySql8.0准备 二.安装pymysql 三.安装mysqlclient 错误解决方法: 四.使用PyCharm的可视化数据库管理工具,连接Mysql8创建数据库 ...

  4. CentOS7.5下安装Mycat连接MySQL8.0

    CentOS7.5下安装Mycat连接MySQL8.0 Posted on 2018-11-08 11:07 许爱琪 阅读(645) 评论(2) 编辑 收藏 MyCat详细介绍,请参考https:// ...

  5. Navicat远程连接MYSQL8.0

    Navicat远程连接MYSQL8.0 MYSQL配置 MYSQL配置 打开my.ini配置,没有的话新建一个,内容按照如下mysql优化配置: [client] port = 3306 #客户端端口 ...

  6. Mycat连接Mysql8.0及以上配置及问题(已解决)

    Mycat连接Mysql8.0及以上问题(已解决) 编辑server.xml 配置文件 vim conf/server.xml <!-- 修改此位置 --><user name=&q ...

  7. dw8与mysql的连接,VS2019连接mysql8.0数据库的教程图文详解

    1.首先准备好vs2019以及mysql数据库,两者都可以去官网下载,我们直接描述连接过程. 2.连接: 第一步:打开mysql的安装目录,我本地的安装目录如下:(注意是否有include和lib文件 ...

  8. Navicat连接MySQL8.0出现乱码的解决方案

    Navicat连接MySQL8.0出现乱码的解决方案 参考文章: (1)Navicat连接MySQL8.0出现乱码的解决方案 (2)https://www.cnblogs.com/ray-mr-hua ...

  9. mysql8.0client_navicat 连接mysql8.0 报错client does not support authentication

    navicat 连接mysql8.0 报错client does not support authentication,解决方法: 打开windows Powershell,输入以下命令 ,加红加粗的 ...

最新文章

  1. mysql设置约束l命令_2、MYSQL 基本数据库命令及约束
  2. 另一个小程序 返回的支付结果如何得到_手把手教你测微信小程序
  3. js如何生成[n,m]的随机数
  4. 阿里大数据分析与应用(part4)--一站式大数据平台DataWorks
  5. java bitset用途_BitSet的用法
  6. ad域管理与维护_AD域管理员账号下发
  7. flavr—超级漂亮的jQuery扁平弹出对话框
  8. PV、UV、UIP、VV、CPC、CPM、RPM、CTR指的是什么?
  9. bzoj:1692 [Usaco2007 Dec]队列变换1640 [Usaco2007 Nov]Best Cow Line 队列变换
  10. Equal-size partition problem
  11. hdu acm 1241
  12. VBA的表单控件初接触(2):ActiveX控件的基础功能和基础代码
  13. VB6基本数据库应用(一):数据库基础
  14. 六自由度机械臂运动学分析及其轨迹规划
  15. 2021起重机作业 (Q)模拟考试题库及软件
  16. A Structure from Motion System
  17. 传染病研究-靶向下一代宏基因组测序(mNGS)分析
  18. 客户流失预测——相关论文学习笔记
  19. python视频压缩_Python 怎样将视频压缩?并且尽量不会影响到清晰度
  20. 中交一公局集团:提效翻倍!构建“数据共享、高效管控”的财税管理新模式

热门文章

  1. DUNS邓白氏编码申请流程
  2. 爬虫——豆瓣top250电影爬取实验
  3. 中文分析器IK Analyzer
  4. 关于Spring嵌套事务异常问题
  5. 深度学习笔记(4)——维度操作(2)展平、·拼接、拆分
  6. ubuntu汉字乱码显示为方框的解决办法
  7. sanitizer工具集
  8. 利用android studio实现手机信息界面
  9. 《数字摄影与摄像》——风光摄影
  10. python是什么意思