Friday, December 30, 2016

How to add data Columns and data row in Data Table in ASP.NET



 Adding The Columns Into data Table.


 DataTable MakeTable= new DataTable();
        MakeTable.Columns.Add("Column1", typeof(Int32));
        MakeTable.Columns.Add("Column2", typeof(Int32));
        MakeTable.Columns.Add("Column3", typeof(Int32));
        MakeTable.Columns.Add("Column4", typeof(Int32));
        MakeTable.Columns.Add("Column5", typeof(Int32));
        MakeTable.Columns.Add("Column6", typeof(Int32));
        MakeTable.Columns.Add("Column7", typeof(Int32));

Now add the Row into Table

MakeTable.Rows.Add("Value1","Value2","Value3","Value4","Value5","Value6","Value7");

No comments:

Post a Comment

Featured Post

What is JavaScript? What is the role of JavaScript engine?

  The JavaScript is a Programming language that is used for converting static web pages to interactive and dynamic web pages. A JavaScript e...