2016-09-27 18 views
-1
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { 
    MyForm2^ myform2 = gcnew MyForm2(); 
    String^ constring = L"datasource=localhost;port=3306;username=root;password=root"; 
    MySqlConnection^ conDataBase = gcnew MySqlConnection(constring); 
    MySqlCommand^ cmdDataBase = gcnew MySqlCommand(
     "Update librarysystem.bookdetails set isbn = '" + this->textBox1->Text + 
      "', booktitle = '" + this->textBox2->Text + 
      "', bookauthor = '" + this->textBox3->Text + 
      "', bookcategory = '" + this->comboBox1->SelectedItem + 
      "', bookedition = '" + this->textBox5->Text + 
      "', booknumofcopies = '" + this->textBox4->Text + 
      "' where isbn = '" + myform2->listView1->FocusedItem->ListView + "' ;", 
     conDataBase); 
    MySqlDataReader^ myReader; 

答えて

0
MyForm2^ myform2 = gcnew MyForm2(); 
... 
myform2->listView1->FocusedItem->ListView 

MyForm2のあなたの宣言と間違って何かがあります。ほとんどの場合、あなたは#include "MyForm2.h"ではありませんでした。おそらく'MyForm2' : undeclared identifierについてもエラーが発生しています。

+0

私は何をすべきか、myform2をmyform16に宣言するかどうかは、リストビューツールで接続する必要があるためです –

関連する問題