Visual C++ Tutorial 2 -Windows Forms Application: Mysql Connection Part 1




C++ Windows Form Application Mysql Connection Using Visual C++ Windows Forms with MySQL C++ Windows Form Application Mysql Connection Mysql And …

Original source


29 responses to “Visual C++ Tutorial 2 -Windows Forms Application: Mysql Connection Part 1”

  1. 1.25 speed does work fine, I haven't used VCpp since VS6 So I am just looking to see the changes, I have been using VB C# F# Python and Ruby with VS, Cpp is a great language, It is Just so old there has to be something soon besides Java, I am not a fan of having to run JVM, that sways me away from Java, but Cpp has been the mainstream language for way too many years "C with classes". Visual Haskell would be sweet that just came to me, I use many languages, VS Delphi and C++ builder are great having to code GUI's and have them look awesome is time consuming and horrible, you know it doesn't matter if your app is the best at what it does people will always have that visual aspect they lean towards which is why these enviroments are great

  2. Hi! I made my windows form application with your method. The app is working on my pc (installed full mysql software: client, connector, server). But when I would like to use on another the program starts and when I hit the login button I'm getting "MySql.Data file not found" error.. Any solutions?

  3. Is there a way to make this independent from .NET? I would like my software to run free from the .NET framework. This video blends C++ with C# (.NET dependent language). .

  4. hello,
    i have  a c++ form that accepts data and saves it on a table in a database via a button click, this is the code for the event
    private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {

    String^ constring=L"datasource=localhost;port=3306;username=root;password=lampard";
    MySqlConnection^ conDatabase=gcnew  MySqlConnection(constring);
                 MySqlCommand^ cmdDatabase=gcnew MySqlCommand("insert into test.Data(Full_Name,Matric_No) values('"+this->textBox1->Text+"','"+this->textBox10->Text+"') ;" ,conDatabase);
    MySqlDataReader^ myReader;
    try{
                    conDatabase->Open();
                    myReader=cmdDatabase->ExecuteReader();

    MessageBox::Show("Saved");
    while(myReader->Read()){
     
    }
    }catch(Exception^ex){
    MessageBox::Show(ex->Message);
    }
    NOW i want to send a query to give out this information in a new form or in a form exactly like the one used to enter the data, this is how far i have come 
    private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
    this->Hide();
                 MyForm ^ Form = gcnew MyForm(this);
    Form->ShowDialog();
    String^ constring=L"datasource=localhost;port=3306;username=root;password=lampard";
    MySqlConnection^ conDatabase=gcnew  MySqlConnection(constring);
                 MySqlCommand^ cmdDatabase=gcnew MySqlCommand("Select * from test.Data where Matric_No='"+textBox1->Text +"';",conDatabase);
    MySqlDataReader^ myReader;
    try{
                    conDatabase->Open();
                    myReader=cmdDatabase->ExecuteReader();
    while(myReader->Read()){

    textBox1->Text ;
    }
    }catch(Exception^ex){
    MessageBox::Show(ex->Message);

    }
    }   

    NOte: MyForm is the title of the form used to enter in the data sent to the database
    please how do i get the program to display the data meeting the query criteria into a form?

  5. Hello,
    I am not able to select Mysql.data at properties->common properties->add framework and references->.net
    I am using visual c++ 2008 edition. I also have Mysql and Mysql/C++  Connector.
    Could you please guide me what to do?

Leave a Reply