Populate a datagridview with sql query results

前端 未结 9 1096
旧巷少年郎
旧巷少年郎 2020-12-02 23:02

I\'m trying to present query results, but I keep getting a blank data grid. It\'s like the data itself is not visible

Here is my code:

 private void         


        
9条回答
  •  南方客
    南方客 (楼主)
    2020-12-02 23:47

    Try binding your DataGridView to the DefaultView of the DataTable:

    dataGridView1.DataSource = table.DefaultView;
    

提交回复
热议问题