Skip to content
Loading
  • +1
    You can try somethign like below:
     
    1. try  
    2. {  
    3.    DataSet DS = GetResultsDS(sql); //Execute query and getting result in DataSet.  
    4.     if (DS != "" && DS  != null)  
    5.     {                  
    6.         DS.Tables[0].Columns.Add("DrillDown", typeof(System.String)); //Adding column of string type  
    7.         foreach (DataRow row in DS.Tables[0].Rows)  
    8.         {  
    9.             row["DrillDown"] = "Value for new column"; // setting value  
    10.         }  
    11.     }  
    12. }  
    13. catch (Exception e)  
    14. {  
    15.     logger.Error(e);  
    16. }  
    Source : http://sforsuresh.in/how-to-add-a-column-to-datatable
    +1