Dean
Dean

Reputation: 517

How to Display Datatable Contents into a datagridview?

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

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

Help appreciated

Upvotes: 3

Views: 19647

Answers (2)

John
John

Reputation: 1

sqldataadapter.fill(tbl); DataGridView.Data Source = tbl (higher numbered rows not accessible)

Upvotes: 0

Vijaychandar
Vijaychandar

Reputation: 714

Try this:

gridview.datasource=tbl;

Upvotes: 13

Related Questions