Imports MySql.Data.MySqlClient
Public Shared Function getMySQL(ByVal sqlstr As String) As DataTable
Dim Conn As MySqlConnection = New MySqlConnection(mysql1)
Try
Conn.Open()
Dim da As New MySqlDataAdapter(sqlstr, Conn)
Dim ds As New DataSet
da.Fill(ds, "dt1")
Conn.Close()
Conn.Dispose()
Return ds.Tables("dt1")
Catch ex As Exception
Conn.Close()
Conn.Dispose()
Return Nothing
End Try
End Function
下面就是抛sql给系统执行啦,例如select * from 表