你可以这样参考一下:
将数据库中的图片(s)读取 存放在 byte[] 数组中,通过timer来循环显示!

解决方案 »

  1.   

    这很简单!
    eg:
        将要放入数据库中的图像文件以流式读入
       假设你要读入的文件位置是c:\images\mypic.jpg;
        FileStrem   fs=new FileStream(@"c:\images\mypic.jpg",FileMode.Open,FileAccess.Read);
        BinaryReader br=new  BinaryReader(fs);
        byte[]  imageData=new byte[fs.length];
         imageData=br.ReadBytes[fs.length];
        插入时最好用存储过程
       ge:
      create procedure  insertPhoto
         @id   int,
         @image image=null
        as
            insert into   tableImage  values(@id,@iamge)
       return
        SqlCommand  sqlComad=new SqlCommand(sqlConnnection);
    sqlComad.CommandType=CommandType.StoredProcedure;
    sqlComad.CommandText=insertPhoto;
     SqlParameter im=new SqlParameter();
    im.Name=@"@iamge";
     if(imageData==null)
      im.Value=null
    else
      im.Value=imageData;
    读出时这样做就OK了
        SqlDataReader dr=sqlComamd.ExecuteRead();
    while(dr.Read())
    {
             try
                {
              byte[] image=(byte[])dr.GetValue(1);
              System.IO.MemoryStream  ms=new System.IO.MemoryStream(image);
              Bitmap  bmp=new Bitmap(ms);
              myPicture.Image=bmp;
               }
                 catch
                {   myPicture.Image=bmp;
                    }
                
    }
    主要代码就这些啦,仔细看一下,一定要将图像文件转化为字节数组,
    读出最好用内存文件流,不过如果文件太大的话,就不行了
    不过我认为存路径比较好,
    你去参考一下其它的书
      

  2.   

    这是asp.net : http://www.aspcool.com/lanmu/browse1.asp?ID=830&bbsuser=asp