Select from following answers:- dt.Rows[dt.Rows.Count]["LastName"] = lastName;
- dt.Rows.Add(lastName);
- DataRow dr = dt.NewRow(); dr["LastName"] = lastName; dt.Rows.Add(dr);
- All Above
To add a new row, first call the DataTable.NewRow method. Call the RowCollection.Add method to add to the DataTable.
You should not use the DataRow constructor to create a new DataRow. Use DataTable.NewRow instead.
Show Correct Answer
Source: MeasureUp.Com | |
Alert Moderator