Click here to Skip to main content
15,890,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I try to insert image to MySQL database through C++, and using C++/CLI project to insert the images. Honestely I converted C# code to C++/CLI in order to insert the images. Unlikely I have error which can not be skipped. Could you please help me ?

byte[] imageBt = null; 
this sentence of code does not work in C++, How could I define or convert this code to C++? by other words how can someone define byte matrix in C++/CLI project?

What I have tried:

I tried to use
Byte[] imageBt = {0};
does not work
Posted
Updated 30-Jan-19 21:46pm
v2

1 solution

Storing images in a data base is a bad idea because it gets slow and the data base inflates to much. You better store the image separated in some directory on server and store the name and path to it. Use some unique name for these images like created with some id.
 
Share this answer
 
Comments
EngAb1989 31-Jan-19 3:53am    
Yea; I absolutely agree with you, I stored directroy and image path as string in SQL Databse, but I need to retrieve the images once I click on row or Search by ID. I need to display the images on picturebox. Any idea?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900