Answers for "how can i add a new column inside a datatable"

C#
1

add new column in data table c#

> dt.columns.Add("ColumnName", typeof(Give the type you want));
> dt.Rows[give the row no like  or  or any no]["Column name in which you want to add data"] = Value;
Posted by: Guest on June-17-2021
0

how-to-add-new-column-with-value-to-the-existing-datatable

System.Data.DataColumn newColumn = new System.Data.DataColumn("Foo", typeof(System.String));
newColumn.DefaultValue = "Your DropDownList value";
table.Columns.Add(newColumn);
Posted by: Guest on November-02-2021

Code answers related to "how can i add a new column inside a datatable"

C# Answers by Framework

Browse Popular Code Answers by Language