Quote:
Nothing yet. Don't know what to write
Then you need to do some research. Try starting with
. Work with Image Columns in DataGridView Control - Windows Forms .NET Framework | Microsoft Docs[
^].
To get data from a database, you will need to use a
SELECT
statement - see
SELECT (Transact-SQL) - SQL Server | Microsoft Docs[
^].
The code you posted is not even attempting to populate the
datagridview
, but does have a problem you should address immediately. Your code is vulnerable to SQL Injection attack because you are creating the SQL statement by concatenating user input. See
SQL Injection | OWASP Foundation[
^] for why this is a bad idea and
SQL Injection Prevention - OWASP Cheat Sheet Series[
^] for how to get around it using parameterized queries.
Have an attempt at doing this for yourself and we will be very happy to help you when you get stuck - but we will not write your code for you - even if we could work out what the problem is from so little information you have provided.