Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Display Datatable Contents into a datagridview?

Tags:

c#

winforms

I have a simple DataTable, How can i display everything inside it into gridview?

public void BindData(DataTable tbl)
{
    this.dataGridView1.DataSource = (...)?
}

Help appreciated

like image 887
Dean Avatar asked Dec 09 '25 15:12

Dean


1 Answers

Try this:

gridview.datasource=tbl;
like image 155
Vijaychandar Avatar answered Dec 12 '25 06:12

Vijaychandar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!