To create DataTable.

Jitendrasoft09
Posted by Jitendrasoft09 under ASP.NET category on | Points: 40 | Views : 1043
DataTable _dtTable = new DataTable();

_dtTable.Columns.Add(new DataColumn("FName", typeof(string)));
_dtTable.Columns.Add(new DataColumn("LName", typeof(string)));
_dtTable.Columns.Add(new DataColumn("Address", typeof(string)));
_dtTable.Columns.Add(new DataColumn("Qualification", typeof(string)));

DataRow _drRow;
_drRow = _dtTable.NewRow();
_drRow[0] = " Jitendra";
_drRow[1] = "kumar ";
_drRow[2] = "Bangalore ";
_drRow[3] = "M.Tech ";

_dtTable.Rows.Add(_drRow);

Comments or Responses

Login to post response