How to Bind specific Columns of a datatable to a DataGridView?

前端 未结 6 501
眼角桃花
眼角桃花 2020-12-09 11:43

My DataTable has three columns fetched from a database, while I need to bind only two columns of it to a DataGridView. Can you please help me with

6条回答
  •  借酒劲吻你
    2020-12-09 11:52

    Add the column as answered above, and do not forget to set:

    dataGridView1.AutoGenerateColumns = false;
    

提交回复
热议问题