procedure TForm1.Button1Click(Sender: TObject);
var
  i:integer;
begin
with adostoredproc1 do
begin
   close;
   parameters.clear;
   adostoredproc1.ProcedureName:='byroyalty';   // Parameters.clear;
   Parameters.CreateParameter('@royaltyper',ftstring,pdinput,6,0);
   parameters.ParamValues['@royaltyper']:=400;
   adostoredproc1.Prepared;
   adostoredproc1.ExecProc;
   //stringgrid1.RowCount:=adostoredproc1.RecordCount+1;
   //first;
   for i:=1 to adostoredproc1.recordcount do
   begin
     stringgrid1.Cells[1,i]:=parameters.ParamValues['au_id'];
     next;
   end;
end;
end;