I\'ve been struggling with a NullReferenceException and hope someone here will be able to point me in the right direction. I\'m trying to create and populate a DataTable and the
You need to ensure each column's DataPropertyName property is set to the corresponding name of the DataColumn's ColumnName.
DataPropertyName
DataColumn
ColumnName
You may also need to set the DataGridView's AutoGenerateColumns property to false.
DataGridView
AutoGenerateColumns
false
I found the solution here.