venkat

venkat

  • 1.7k
  • 133
  • 17.5k

how to add one column before generate table

Aug 16 2018 2:12 AM
Hi all,
 
The below code will generate table and i binded to the excel it is working fine .
 
public static DataTable GetTable()
{
// Here we create a DataTable with four columns.
DataTable table = new DataTable("Example Values");
table.Columns.Add("tyu", typeof(string));
table.Columns.Add("wer", typeof(int));
table.Columns.Add("adf", typeof(string));
// Here we add DataRows.
table.Rows.Add("lkj", "oip", "hn");
table.Rows.Add("hj", "hj", "yuu");
return table;
}
 
output :
 
 
 
above output is fine but here i need to small change like wants to add some text on top of the table.
 
i want to add one column on top of the table
 
 

Answers (2)