Delphi高手!
如何把Delphi 中的 Image 控件的图像保存到Sql Server 2000中,Sql Server 2000中的字段类型为Images!存入之后又如何把Sql Server 2000中的图片取出来,显示在Image 控件上!
请高手指教!谢谢!

解决方案 »

  1.   

    http://218.56.11.178:8020/web/index.aspx->  软件基地 ->delphi源码-》数据库/报表-》数据库存储bmp/jpg图片(sql  server)
      

  2.   

    首先把这个图片读入到一个BlodField字段中,然后再把这个字段保存到数据库就行了。你可以在Delphi帮助时查找BoldField字段的说明与定义。
      

  3.   

    1.存储:fieldByName('img').assign(image1.picture.bitmap);
    2.删除:fieldByName('img').value:=nil;
    3.显示:image1.Picture.Assign(tblobfield(query.fieldbyname('img'));
      

  4.   

    或者如下:
    把图片保存到image字段中
    var myfilestream:tfilestream;
        myblob:tblobfield;
    begin
    adoquery1.edit;
    picturepath:='c:\a.bmp';
    myfilestream:=tfilestream.Create(picturepath,fmopenread);
    myblob:=tblobfield(adoquery1.FieldByName('Photo'));
    myblob.LoadFromStream(myfilestream);
    myfilestream.Free;
    adoquery1.Post;
    把字段中的图片读出到image控件中
    Image1.Picture.bitmap.assign(tblobfield(adoquery1.fieldbyname('Photo')));