I am developing a C # desktop application using Visual Studio Express 2010.
I have a table in MySQL called Products with three fields:
ID → Product_Name → product_image
The product_Image field saves the image path on my hard drive (not the image itself)
Record Example:
0001 --- XYZ Mouse Pad ---- c: \ images \ mousepad.jpg
I wonder how to populate a datagridview that shows ID, Produt name, and - especially - the product image for each record in my SQL query.
In all the examples that I found, manual data inserts were used, but I'm looking for an example to populate a datagridview with data from an SQL query, rather than with manual insertion.
Edit:
Thank you for your help, but could not directly apply the solutions.
I already have a datagridview in my form, I do not need to create at runtime.
I need something like this (I will write a general way)
returnMySQL = "select * from products"; while (returnMySQL) { fill datagrid with ID, product name, product image }
source share