把数据库里的图片值输出到图片框,请问如何操作?

解决方案 »

  1.   

    <? 
    //连接MYSQL 
    mysql_connect("localhost","username","password"); //选择数据库 
    mysql_select_db("tablename"); //sql语句 
    $sql=mysql_query("select * from tablename;"); echo "<table>\r"; 
    echo "<tr><td>ID</td><td>NAME</td><td>DATA</td></tr>\r"; //循环输出所有内容到表格里mysql_fetch_array()是将结果存为数组 
    while($res=mysql_fetch_array($sql)){ 
    echo "<tr><td>".$res["ID"]."</td><td>".$res["Name"]."</td><td>".$res["Data"]."</td></tr>\r"; 
    } echo "</table>\r"; 
    ?> 自己改改吧
      

  2.   

    你可以使用blob扔进去,然后再取出来,然后绑定到图片控件上!当然最好在数据库存路经!
      

  3.   

    你获取的数据是Table byte[] _ImageBytes =(byte[])Table.Rows[0][0];
    Image _Image =Image.FormStream(new MemoryStream(_ImageBytes));去显示图片就可以了..如果你需要加边框.. 你可以把图形显示到BackgroundImageImage显示图形...但注意你的边框要透明的
      

  4.   

    你在数据库里面保存图片????  你的数据库有点吓人了  呵呵呵null应该能判断出来
    if(取出的图片对象==null)
    {
    ///
    }