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);
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);
datatable in c#
String[] arr = new String[] { "a", "b" };
DataTable dt = new DataTable();
dt.Columns.Add("name");
dt.Columns.Add("other");
dt.Rows.Add(arr);
foreach (DataRow r in dt.Rows)
{
Console.WriteLine(r["name"].ToString() + " - " + r["other"].ToString());
}
how to make a datatable in c#
Datatable NameHere = new DataTable();
NameHere.Rows.Add("Whateveryoudliketoaddintorstringoranything");
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us