title: How do I solve the Exception with message: "A column named 'Name' already belongs to this DataTable"?
body: <p>I am getting the following error which says; A column named 'Name' already belongs to this DataTable. how can i sove this error, i tried to look for
  some solutions but i cant get it working    </p>
  
  <pre><code>private DataTable GetDataTableFromDataGridview(DataGridView _grid)
      {
        {
              var _oDataTable = new DataTable();
              object[] cellValues = new object[_grid.Columns.Count];
              foreach (DataGridViewRow row in _grid.Rows)
              {
                  for (int i = 0; i &lt; row.Cells.Count; i++)
                  {
                      clearTable();
                      _oDataTable.Columns.Add("Name", typeof(string)); //error here
                      _oDataTable.Columns.Add("Value", typeof(string));
                      _oDataTable.Columns.Add("Font", typeof(string));
                      _oDataTable.Columns.Add("DateStamp", typeof(string));
                      _oDataTable.Columns.Add("Comment", typeof(string));
                      cellValues[i] = row.Cells[i].Value;
                  }
                  _oDataTable.Rows.Add(cellValues.ToArray());
              }
              return _oDataTable;
  
          } 
       public void clearTable()
      {
          DataRow _datarow;
          oDataTable.Clear();
          _datarow = oDataTable.NewRow();
          Gridview_Output.DataSource = oDataTable;
      }
  
      }
  </code></pre>