How to bind dataGridView predefined columns with columns from sql statement (without adding new columns)?

前端 未结 5 1325
萌比男神i
萌比男神i 2021-02-13 22:30

Is there a elegant way, to bind predefined dataGridView columns with results from a SQL statement?

Example:

dataGridView1.Columns.Add(\"EID\", \"ID\");
d         


        
5条回答
  •  野的像风
    2021-02-13 23:24

    Use dataGridView1.Columns["FName"].DataPropertyName = "FName" where FName is column in your data table.

提交回复
热议问题