kiko yang

kiko yang

  • NA
  • 4
  • 10.4k

how to populate mysql union query by using dataset in VB.Net?

Oct 17 2011 5:29 AM
Hi all, regarding to the subject. I'm using MySQL and VB.NET. I was unable to output the value as it always return with empty value but i can get the value by using mysql console. I'm using the below query and codes:

Dim strSQL as string
Dim objRS As DataSet
Dim objConn As MySqlConnection
objDataAdapter = New MySqlDataAdapter

strSQL = "SELECT MAX(memberID) as max_member_id FROM ((SELECT memberID FROM A) UNION (SELECT memberID FROM B))";
objDataAdapter.SelectCommand = New MySqlCommand(strSQL, objConn)
objDataAdapter.Fill(objRS)


Anyone has the idea how to do that? Thanks a lot.



Answers (2)