So I'm trying to get data from a MySQL database and display it in a messageBox but I don't know how to get the result of the query I made, here's my code:
String^ constring = L"datasource=localhost; port=3306; username=root; password="; /
MySqlConnection^ conDB = gcnew MySqlConnection(constring);
MySqlCommand^ Query = gcnew MySqlCommand("SELECT Bar FROM utilizadores.users WHERE username='"+user+ "' ", conDB );
MySqlDataReader^ reader;
conDB->Open();
try
{
reader = Query->ExecuteReader();
MessageBox::Show(/*Result of the Query here*/);
}
catch (Exception^ex)
{
MessageBox::Show(ex->Message);
}
What do I have to put inside the MessageBox to display the result of that query?
Thanks