我用的是ado控件,是不是要使用流的方式,不用要如何,用又如何
哪位帮帮我

解决方案 »

  1.   

    写:
    procedure TForm1.btnInsertClick(Sender: TObject);
    var
      tmpStream: TMemoryStream;
    begin
      tmpStream := tmpStream.Create;  with ADOQuery1 do
      begin
        close;
        sql.Clear;
        SQL.Add(Format('insert into TPic(pName,pic) values(''%s'',:picFile)',[edit2.Text]));
        Parameters.ParamByName('picFile').Assign(image1.Picture);
        ExecSQL;
      end;  tmpStream.Free;end;读
    procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect;
      Field: TField; State: TGridDrawState);
    begin
      if (Field.FieldName ='pic')and (gdFocused in State) then
         Image1.Picture.Assign(TBlobField(ADOQuery1.FieldByName('pic')))
      else
        Image1.Picture.Assign(nil);
    //    ;
    end;
      

  2.   

    很感谢各位朋友帮忙,真是不好意思,我搞错了
    我用的是socket和clientdataset控件,那又如何做?
    非常抱赚