Hello Forum,
What I want is to get info into to a textbox from the mysql database when the user clicks a button.
So far I have it so it connects and then opens up. Then you can send querys from the textbox to the database.
I'm having trouble in fetching/retriving data and putting into a textbox or table.
What I have so far:
Using
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace MySql::Data::MySqlClient;
The Query
private: System::Void RunQuery_Click(System::Object^ sender, System::EventArgs^ e)
{
String^ SQLQuery = QueryBox->Text;
String^ connectionInfo = "datasource=localhost;port=3306;username=root;password=blacklegion;database=testing";
MySqlConnection^ conn = gcnew MySqlConnection(connectionInfo);
MySqlCommand^ connCMD = gcnew MySqlCommand(SQLQuery, conn);
MySqlDataReader^ dataReader;
try
{
conn->Open();
dataReader = connCMD->ExecuteReader();
}
catch(Exception^ex)
{
MessageBox::Show(ex->Message);
}
}
Reason why I'm trying to get it to work is that I have a Cpu Auth which i'm going to incorperate with the DB conneciton and fetch Keys within the db.
I need to some how fetch the keys and read it from the db.
This is the cpu auth
void CpuKeyCheck()
{
BYTE hvCpuFuse1[0x10];
BYTE cpuKeyBytes[0x10];
BYTE CPUKey[0x10] =
{
0x22, 0x66, 0x39, 0xDC, 0x2D, 0xE7, 0x25, 0x9F0, 0x91, 0xE6, 0x88, 0xDC, 0x1E, 0xDD, 0x78, 0x5A
};
HvPeekBytes(0x20, cpuKeyBytes, 0x10);
QWORD f1p1 = HvGetFuseLine(3) | HvGetFuseLine(4);
QWORD f1p2 = HvGetFuseLine(5) | HvGetFuseLine(6);
memcpy(hvCpuFuse1, &f1p1, 8);
memcpy(hvCpuFuse1 + 8, &f1p2, 8);
if (memcmp(hvCpuFuse1, cpuKeyBytes, 0x10) != 0)
HalReturnToFirmware(HalResetSMCRoutine);
if (memcmp(hvCpuFuse1, CPUKey, 0x10) != 0)
HalReturnToFirmware(HalResetSMCRoutine);
}
Thanks in advanced for anyone to help me or guide me =],
Sir
What I have tried:
I've tried google but I don't know what I'm looking for , silly I know but it's why I need help.