title: Modifying a DataTable
body: <h2>Situation:</h2>
  
  <p>Hello! I am trying to populate a WPF toolkit DataGrid with a MS Access database.</p>
  
  <p>Here is what I have right now (it works):</p>
  
  <pre><code>//Load the datagrid with the database
      private void LoadDataGrid(string filename, string path)
      {
          string databaseConn = "Provider=Microsoft.ACE.OLEDB.12.0;" +
                                "Data Source=" + path + "\\" + filename,
                 tableName ="";
          OleDbConnection conn = null;
          DataTable schemaTable,
                    table = new DataTable();
  
          try
          {
              conn = new OleDbConnection(databaseConn);
              try
              {
                  conn.Open();
                  schemaTable = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables,
                                                         new object[] { null, null, null, "TABLE" });
                  tableName = "[" + schemaTable.Rows[0].ItemArray[2].ToString() + "];";
                  string sqlQuery = "SELECT * FROM " + tableName;
                  OleDbCommand command = new OleDbCommand(sqlQuery, conn);
                  OleDbDataReader reader;
                  reader = command.ExecuteReader();
                  table.Load(reader);
                  DataGrid_.ItemsSource = table.DefaultView;
              }
              catch (Exception ex)
              {
                  System.Windows.MessageBox.Show(ex.Message); 
              }
              finally
              {
                  conn.Close();
              }
          }
          catch (Exception ex)
          {
              System.Windows.MessageBox.Show(ex.Message); 
          }
      }
  </code></pre>
  
  <p>The code sample above loads a WPF toolkit DataGrid with the help of a MS Access database.</p>
  
  <p>What I would like to do is be able to insert a column in the DataGrid at the very beginning. This column would be used to write the row number. What I think could work is to modify the <strong><em>table</em></strong> variable (which is a <strong>DataTable</strong> object). </p>
  
  <hr>
  
  <h2>Question:</h2>
  
  <p>So, how can I insert a column in the <em>table</em> variable, add the row number for each rows in that new column, and have all the data from the database in the DataGrid?</p>