Ver Mensaje Individual
  #1  
Antiguo 03-07-2012
edgar_prospero edgar_prospero is offline
Miembro
NULL
 
Registrado: mar 2012
Posts: 202
Reputación: 13
edgar_prospero Va por buen camino
grabar stringgrid en mysql

que hay amigos a ver quien puede ayudarme tengo un stringgrid al cual inserto valores por medio de edits pero lo que quiero lograr es esa informacion que tengo en el stringrid guardarla en mysql no se si esto sea posible lo intente de la siguiente manera pero no me funciono


Código Delphi [-]
procedure TForm4.Button3Click(Sender: TObject);
begin

  StringGrid1.Cells[3, StringGrid1.Row] := precio.Text;

             
tabla.SQL.Clear;
tabla.Close;

tabla.SQL.Add('insert into cobro(folio, cantidad, codigo, descripcion, unitario)values(: pfolio, : pcantidad, : pcodigo, : pdescripcion, : punitario) ');

tabla.ParamByName('folio').AsString:=StringGrid1.Cells[0, StringGrid1.Row];
tabla.ParamByName('cantidad').AsString:=StringGrid1.Cells[0, StringGrid1.Row];
tabla.ParamByName('codigo').AsString:=StringGrid1.Cells[0, StringGrid1.Row];
tabla.ParamByName('descripcion').AsString:=StringGrid1.Cells[0, StringGrid1.Row];
tabla.ParamByName('unitario').AsString:=StringGrid1.Cells[0, StringGrid1.Row];


tabla.ParamByName('pfolio').AsString:=folio.Text;

//StringGrid1.Cells[0, StringGrid1.Row]:= query.FieldByName('cantidad').asString;
//StringGrid1.Cells[0, StringGrid1.Row]:= query.FieldByName('folio').asString;

tabla.Execute;

Última edición por Casimiro Notevi fecha: 04-07-2012 a las 00:42:05.
Responder Con Cita