vivekj2004
asked on
C# (in memory table
what is the meaning of these two lines:
DataTable x = new DataTable();
x.Columns.Add("Code", typeof(int));
I mean conceptually what are they doing (especially in a windows applications). I would like special description of pupose of second line.
DataTable x = new DataTable();
x.Columns.Add("Code", typeof(int));
I mean conceptually what are they doing (especially in a windows applications). I would like special description of pupose of second line.
ASKER
if there is no second parameter there e.g.,:
x.Columns.Add("val");
does this mean that the column type will be string?
x.Columns.Add("val");
does this mean that the column type will be string?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
x.Columns.Add("Code", typeof(int)); = you are adding a column of type int to the table x.
below the code is for adding some values to it
DataRow dr=x.NewRow();
dr["Code"]="1"
dt.Rows.Add(dt)