I've got a button that sends an sql query to the database it works but i don't know how to fill the datagrid with the results of that query
Printable View
I've got a button that sends an sql query to the database it works but i don't know how to fill the datagrid with the results of that query
Have a look at the DataTable class and see if that helps:
http://msdn.microsoft.com/en-us/libr...datatable.aspx
Once you've populated the DataTable instance with the results of your SQL query, it's just a matter of binding the DataGridView instance to that:
It will be automatically populated.Code:MyGridView.DataSource = MyDataTable