❔ Syntax error, datagridview shows nothing
I've been working on winform application and had troubles of showing info fro a db to a datagridview. Didn't know what do so I played around. Now when I run the app i get an error. Cant quite see what the problem is. Any suggestion for a better query?
4 Replies
That trailing comma in your concat function call might be a problem.
Also this is SQL injection which is a bad habit to get into. I understand for learning projects doing it the "right" way is a bit of a pain, but you might want to learn how to do parameterized SQL instead of concatenating user input that could do terrible things to you database.
Yeah the comma was the problem, thanks. The datagridview didn't show any data where "concat - like" query but did with only (select * from tbUser). Why is that?
Perhaps your query returned zero rows.
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.