How to Add an Empty row into DataTable?

 Posted by vishalneeraj-24503 on 12/20/2013 | Category: ADO.NET Interview questions | Views: 918 | Points: 40
Answer:

We can Add an Empty row into DataTable with the help of Rows static method.

DataTable dt_employee = new DataTable();

dt_employee.Columns.Add("Name");
dt_employee.Columns.Add("Address");

dt_employee.Rows.Add(string.Empty, string.Empty);


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response