Is there a elegant way, to bind predefined dataGridView columns with results from a SQL statement?
Example:
dataGridView1.Columns.Add(\"EID\", \"ID\");
d
If you are doing WinForm, the important part is setting the DataPropertyName
property to match the DataTable Column name. You can do it in the designer or code as follows:
Me.AccountDataGridView.Columns("Account").DataPropertyName = "Account"
Of course, having set this:
Me.AccountDataGridView.AutoGenerateColumns = False