Column order to adjust the DataTable DataTable modify the column name delete columns adjust the column order

 

Address: https: //www.cnblogs.com/gaocong/p/6490159.html

Title: DataTable column names modify delete columns adjust the column order

MyDt = DataTable dt;  
 // delete columns   
myDt.Columns.Remove ( " minArea " );  
myDt.Columns.Remove("maxArea");  
  
// adjust the column order, column sorted from 0   
myDt.Columns [ " NUM " ] .SetOrdinal ( . 1 );  
  
// modify the column header names   
dt.Columns [ " NUM " ] .ColumnName = " search volume " ;  
dt.Columns [ " Rate " ] = .ColumnName " percentage " ;

 

Guess you like

Origin www.cnblogs.com/Tpf386/p/11984795.html