title: The INSERT INTO statement contains the following unknown field name: 'NoName'
body: <p>The <code>INSERT INTO</code> statement contains the following unknown field name:</p>
  
  <blockquote>
    <p>'<code>NoName</code>'.  Make sure you have typed the name correctly, and try the
    operation again.</p>
  </blockquote>
  
  <p>That is the error thrown when I try to insert a record into a <code>dbase</code> file (<code>.dbf</code>) from a <code>.Net</code> app I am working on.</p>
  
  <p>I use <code>Oledb</code> connection like this:</p>
  
  <pre><code>OleDbConnection connection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\David\Desktop\Dbase_Files;Extended Properties=dBASE IV;User ID=Admin;Password=");
  </code></pre>
  
  <p>I had similar issues while selecting. Some columns get returned as '<code>NoName</code>' but still with data. I simply use the column index number in place of the column name.</p>
  
  <p>Now I need to insert and it has been a block. Same error comes up with say (when you don't list out the column names):</p>
  
  <pre><code>INSERT INTO [tablename.dbf] VALUES (?, ?, ?);
  </code></pre>
  
  <p>Sample full code below:</p>
  
  <pre><code>OleDbConnection connection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\David\Desktop\Dbase_Files;Extended Properties=dBASE IV;User ID=Admin;Password=");
  
  connection.Open();
  
  OleDbTransaction trans = connection.BeginTransaction();
  OleDbCommand command = new OleDbCommand(@"INSERT INTO [tablename.DBF] 
                                          VALUES
                                          (
                                          ?, ?, ?
                                          );", connection, trans);
  
  command.Parameters.AddWithValue("param1", 7);
  command.Parameters.AddWithValue("param2", "RCN");
  command.Parameters.AddWithValue("param3", 0);
  
  try
  {
      command.ExecuteNonQuery();
      trans.Commit();
  }
  catch (Exception e)
  {
      trans.Rollback();
      throw e;
  }
  finally
  {
      connection.Close();
  }
  </code></pre>
  
  <p>I have seen forums discuss this when it happens in <code>Ms Access</code>. But nothing much so far on <code>dbase</code>. Been thinking it is a <code>driver</code> thing.</p>
  
  <p>The <code>dbase</code> file was created by <code>dbase plus (2007)</code> application.</p>