Multiple choice technology web technology

Which method is used to create a new row in a Table?

  1. Add()

  2. NewRow()

  3. Read()

  4. ExecuteReader()

Reveal answer Fill a bubble to check yourself
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.