title: Using TSimpleDataset for multiple purposes
body: <p>Delphi 2010</p>
  
  <p>I am trying to use TSimpleDataset for multiple purposes.</p>
  
  <pre><code>var
   q: tsimpledataset;
   row: String;
   n: Integer;
  begin
   q:=tsimpledataset.create(nil);
   q.connection:= SQLConnection1 ; 
   q.dataset.commandtype:=ctQuery ;
   q.dataset.commandtext:='select lastid from last_id where tablename=:ARow';
   q.Params.Assign(q.Dataset.Params);
   ShowMessage(q.dataset.commandtext);
   row:='accounts';
   q.params[0].asstring:=  row;
    q.open;
   if q.isempty then
    raise exception.create('No matching row found in LAST_ID table.');
   n:=q.fieldbyname('lastid').asinteger +1;
   q.close;
   q.dataset.commandtype:=ctQuery ;
   q.dataset.commandtext:='update last_id set lastid=22';
   q.execute;  //exception Here!
  end;
  </code></pre>
  
  <p>I get the following error on the q.Execute line:</p>
  
  <p>Missing Data provider or Data packet</p>
  
  <p>Seems to be a problem with the closing of the TSimpleDataset and the reuse of it.
  It would work if i freed it and recreated it and reassined the properties and new properties to use it for an execute.  However, i would like to not have to do that. I would like to be able to close it, and then assign a new CommandText and reuse it.</p>
  
  <p>I have researched and read alot of comments on the internet reagrding not using the buggy TSimpleDataset, to use the three other components instead (ClientDataSet, DataSetProvider and SQLDataSet).  You would think that by 2010 Embarcadero would have worked out any issues with the TSimpleDataset.</p>
  
  <p>Is there any workaround other than having to swictch to something other than a TSimpleDataset?</p>
  
  <p>Thanks!</p>