alu

alu

  • NA
  • 6
  • 0

Help! TableMappings and ColumnName in dataGrid

Nov 28 2003 7:54 AM
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?