Dim conn As MySql.Data.MySqlClient.MySqlConnection
Dim cmd As MySql.Data.MySqlClient.MySqlCommand
Dim connStr As String = "server=localhost; port=123; user id=root; password=root; database=bb2_default;CharSet=utf8"
conn = New MySql.Data.MySqlClient.MySqlConnection(connStr)
conn.Open
cmd = new MySql.Data.MySqlClient.MySqlCommand("S elect * FROM ab",conn) ‘执行SQL语句’
'cmd = new MySql.Data.MySqlClient.MySqlCommand("CALL YYS(1)", conn) '执行过程
Dim sdr As MySql.Data.MySqlClient.MySqlDataReader
sdr = cmd.ExecuteReader()
Output.Show(sdr.FieldCount) ‘获取当前行的列数’
Output.Show(sdr.Getname(0)) ‘列名’
Do While sdr.read()
Output.Show(sdr("列名").Tostring())
Loop
conn.close
这样可以实现不使用table来接收mysql数据了。