Populating DataGridView with a Class

HLeyes

Member
Joined
Feb 10, 2016
Messages
15
Programming Experience
10+
Can someone directly me to a brief example of a class and method that will populate a DataGridView from a SQL Server database. I have methods in a class that will retrieve data for data binding with text boxes, but I'd like to see an example for use with a DataGridView.

Thanks in advance,

HL
Fort Myers, FL
 
If you can already get data then you can already get data. That's the same regardless of what you intend to do with the data. The only thing that changes is what you do with the data. In this case, you bind to the DataGridView instead of the TextBoxes. Presumably you have a DataTable. Simply assign that DataTable to the DataSource property of the grid or, if you're using one, the BindingSource.
 
Back
Top Bottom