Which method is used to create a new row in a Table?
-
Add()
-
NewRow()
-
Read()
-
ExecuteReader()
B
Correct answer
Explanation
NewRow() creates a new DataRow object with the schema of the table but does NOT add it to the table's Rows collection - you must call DataTable.Rows.Add() afterward. Add() directly adds to the collection. Read() and ExecuteReader() are data retrieval methods.