0
Answer

Help! TableMappings and ColumnName in dataGrid

alu

alu

20y
1.6k
1
The schema of the DataSet should not match the names of the columns in the database and dataGrig too. I used a TableMappings to do this. oleDbMyAdapter.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] { new System.Data.Common.DataTableMapping("Table", "myTable", new System.Data.Common.DataColumnMapping[] { new System.Data.Common.DataColumnMapping("name1", "myName1"), new System.Data.Common.DataColumnMapping("name2", "myName2")})}); ....... oleDbMyAdapter.Fill(dataSet,"myTable"); dataGrid.SetDataBinding(dataSet,"myTable"); The names of the columns in dataGrid are not changed and match the name of the columns in the database !!! What can i do?