datatable in c# example

Example 1: C# create DataTable

DataTable dt = new DataTable(); 
dt.Clear();
dt.Columns.Add("Name");
dt.Columns.Add("Marks");

DataRow _ravi = dt.NewRow();
_ravi["Name"] = "ravi";
_ravi["Marks"] = "500";
dt.Rows.Add(_ravi);

Example 2: datatables.net

Javascript123$(document).ready( function () {    $('#myTable').DataTable();} );

Example 3: how to make a datatable in c#

Datatable NameHere = new DataTable();
NameHere.Rows.Add("Whateveryoudliketoaddintorstringoranything");

Tags:

Html Example