title: How to add new row to an already existing DataTable on Runtime in C# MVC on Runtime
body: <p>I have a datatable 'tblTest'. When I try to add next row, the first row will get deleted. I need to add data as the second row. Find my code below.</p>
  
  <pre><code>DataTable dt = new DataTable("tblTest"); // Declare as Global.
  public JsonResult SaveTestData(string itemCode,int quantity)
  {
      dt.Columns.Add("ItemCode", typeof(string));
      dt.Columns.Add("Quantity", typeof(int));       
      DataRow dr;
      dr = dt.NewRow();
      dr["ItemCode"] = itemCode;
      dr["Quantity"] = quantity;
      dt.Rows.Add(dr);
      return Json(1);
  }
  </code></pre>
  
  <p>The 'SaveTestData' function repeats and need to add rows as the next row.</p>