populate data from mysql union query by using dataset (VB.NET)

Dataset , MySQL , VB.NET , UNION Sungai Ara, Malaysia
  • 6 years ago

    Hi all,

    Hi all, I'm using MySQL and VB.NET. I was unable to output the dataset 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)
    

    Any help would be appreciated. Thanks.

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook