So let me start by saying that I am a complete beginner when coding in C++ windows/forms program. I was able to get my SQL database connection up with my program. I've ran some simple tests and it looks like my program is able to do simple queries such as inserting values into a table and such. My real hope, now, is for me to have my program take what's in one of my textboxes (username textbox for this example) and put it into my SQL database (Polynomigra), table (logins), field (username). I have not a clue how the syntax goes for this query. I also have no idea why the data type "string" is not existent in C++ windows forms applications. Can someone help me out? And again, I mention to you all that I am a complete beginner at this--I'm teaching myself how to do this.
Thanks and here's the code.
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
MySqlConnection^ con = gcnew MySqlConnection("Network Address=localhost;" "User Name='root';" "Password='password';" "database=Polynomigra");
con->Open();
string username = usernameText.Text;
MySqlCommand^ cmdExecute = gcnew MySqlCommand("INSERT INTO logins VALUES ('1','testuser','testpassword')", con);
MySqlDataReader^ reader = cmdExecute->ExecuteReader();
con->Close();
}