在vb.net MySQLDataAdapter中进行双SQL查询

时间:2013-07-09 02:39:45

标签: mysql sql vb.net

我无法弄清楚为什么这行不会在DataGrid中返回任何内容,而当我使用一个SQL查询(不是双重SELECT)时,它可以正常工作:

Dim DataAdapterInb As New MySqlDataAdapter("SELECT * FROM (SELECT * From inbox WHERE receiverid='" & ID & "') LIMIT 0,5;", MySqlConnection)

1 个答案:

答案 0 :(得分:2)

请查看更新的答案。

Dim DataAdapterInb As New MySqlDataAdapter
("SELECT t.* FROM 
       //^Changed
(SELECT * From inbox WHERE receiverid='" & ID & "')t
LIMIT 0,5;", MySqlConnection)                    //^Changed