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 :(得分:0)
>>> from decimal import Decimal
>>> '{:010.4f}'.format(Decimal('10.0040'))
'00010.0040'
>>> '{:010.4f}'.format(Decimal('-10.0040'))
'-0010.0040'
你的MyForm2声明有问题。最有可能的是你没有MyForm2^ myform2 = gcnew MyForm2();
...
myform2->listView1->FocusedItem->ListView
。您可能还会收到有关#include "MyForm2.h"
的错误消息。