Ver Mensaje Individual
  #1  
Antiguo 24-02-2016
Avatar de Edwardfeliz
Edwardfeliz Edwardfeliz is offline
Miembro
 
Registrado: abr 2014
Posts: 102
Reputación: 11
Edwardfeliz Va por buen camino
No me recore el string Grind y me ingresa la misma linea

Saludos,
No me recore el string Grind y me ingresa la misma linea las mismas veces que el la cantidad de lineas.
Este es el codigo.
Código Delphi [-]
var
i : integer;
Begin
For i := 1 to Sg.RowCount-1 do
begin
QTemp.SQL.Clear;
QTemp.SQL.Text := 'Insert Into FacturaItem (CodFactura, CodParte, Cantidad, Descripcion, Precio,'+
                  'Total, Impuesto) Values '+
                  '(:CodFactura, :CodParte, :Cantidad, : Descripcion, :Precio, :Total, :Impuesto)';
QTemp.Parameters.ParamByName('CodFactura').Value   := CodigoFact;
QTemp.Parameters.ParamByName('CodParte').Value     := SG.Cells[0, SG.Row];
QTemp.Parameters.ParamByName('Cantidad').Value     := SG.Cells[1, SG.Row];
QTemp.Parameters.ParamByName('Descripcion').Value  := SG.Cells[2, SG.Row]; 
QTemp.Parameters.ParamByName('Precio').Value       := SG.Cells[3, SG.Row]; 
QTemp.Parameters.ParamByName('Total').Value        := SG.Cells[4, SG.Row]; 
QTemp.Parameters.ParamByName('Impuesto').Value     := SG.Cells[5, SG.Row];
QTemp.ExecSQL;
end;

Quiero que me agregue cada linea del string grid a la tabla de forma independiente.
Chao
Responder Con Cita