Answer: DataTable has Columns property and Columns has Add static method,so with the help of Add method we can add any columns into DataTable.
For Example:-
DataTable dt_employee = new DataTable();
dt_employee.Columns.Add("Employee_Code");
dt_employee.Columns.Add("Employee_Name");
Here,Employee_Code and Employee_Name will be treated as DataTable Columns.
Asked In: Many Interviews |
Alert Moderator