How fix error below code on visual c++/cli?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
con = gcnew MySqlConnection("datasource=localhost; port=3306; username=root; password=41556126;");
			String^ selectQuery = "select * from info.images where id='"+textBox1->Text+"'";
            cmd = gcnew MySqlCommand(selectQuery, con);
            adp = gcnew MySqlDataAdapter(cmd);
            DataTable^ table = gcnew DataTable();
            adp->Fill(table);

			MySqlDataReader ^ mr;
			con->Open();
			mr=cmd->ExecuteReader();
			
            if (table->Rows->Count == 0)
            {
                pictureBox1->Image = nullptr;
                MessageBox::Show("Data not found!");
            }
            else
            {
			
                byte[] img = (byte[])table->Rows[0][1];
                MemoryStream ^ ms = gcnew MemoryStream(img);
                pictureBox1->Image = Image::FromStream(ms);
				con->Close();
            }
It show error on line 20 for this words (byte[], img)
and line 21 for this word(img)
Registered users can post here. Sign in or register to post.