title: SQL CE 3.5 problem with TableDirect table access
body: <p>I try to insert hundreds of records into empty database table using TableDirect type of SqlCeCommand. The problem is I get an exception SqlCeException "Unspecified error" when calling SqlCeResultSet::Insert. Below is my code. Any hints? </p>
  
  <p>Thanks</p>
  
  <pre><code>    public bool StoreEventsDB2(List&lt;DAO.Event&gt; events)
      {
          try
          {
  
              SqlCeCommand command = new SqlCeCommand("Event");
              command.CommandType = System.Data.CommandType.TableDirect;
  
              SqlCeResultSet rs = _databaseManager.ExecuteResultSet(command, ResultSetOptions.Updatable | ResultSetOptions.Scrollable );
  
              foreach (DAO.Event theEvent in events)
              {
                  SqlCeUpdatableRecord record = rs.CreateRecord();
                  record.SetInt32( 0, theEvent.ID );
                  record.SetInt32( 1, theEvent.ParentID);
                  record.SetString(2, theEvent.Name);
                  record.SetDateTime(3, theEvent.DateTime);
  
                  record.SetDateTime(4, theEvent.LastSynced);
                  record.SetInt32(5, theEvent.LastSyncedTS);
  
                  record.SetString(6, theEvent.VenueName);
                  record.SetBoolean(7, theEvent.IsParentEvent);
  
                  record.SetDateTime(11, DateTime.Now);
  
                  rs.Insert(record);
              }
  
          }
          catch (SqlCeException e)
          {
              Log.Logger.GetLogger().Log(Log.Logger.LogLevel.ERROR, "[EventManager::StoreEventsDB] error: {0}", e.Message);
              return false;
          }
          catch (Exception e)
          {
              Log.Logger.GetLogger().Log(Log.Logger.LogLevel.ERROR, "[EventManager::StoreEventsDB] error: {0}", e.Message);
              return false;
          }
          return true;
      }
  </code></pre>