如何显示一个图象? 数据库中有以<Binary>存贮的图象。怎样将它显示出来? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 将它先读到缓冲区image,然后将image显示出来 参考以下示例你在A页面中这样写:<img src=show.aspx?id=xx>然后在b页面如下写string id = this.Request.QueryString["id"];OleDbCommand myCommand = this.conn.CreateCommand(); string sql = "select fileblob,filemime from table where id = " + id; myCommand.CommandText = sql; OleDbDataReader myRead = myCommand.ExecuteReader(); //开始读取 if(myRead.Read() == true) { Byte[] Buffer = (Byte[])myRead[0]; //输出 this.Response.Clear(); this.Response.ContentType = myRead[1].ToString(); this.Response.BinaryWrite(Buffer); this.Response.End();} 在一个页内完成,如下点击 关于商品分类父节点和子节点的问题 显示图片 cmd.Parameters.AddWithValue("@TypeId", MySqlDbType.Int32).Value = node.Value;报错 C#中的传值问题````````` 我想分行显示警告信息 http://localhost/myweb可以,http://127.0.0.1/myweb就不行 DataGrid实现修改和删除 请教,从Web页接受参数查询数据库? 打开另一个网页再刷新一下??? 急,调用javascript问题???? 新手求助!!!
<img src=show.aspx?id=xx>然后在b页面如下写string id = this.Request.QueryString["id"];
OleDbCommand myCommand = this.conn.CreateCommand();
string sql = "select fileblob,filemime from table where id = " + id;
myCommand.CommandText = sql;
OleDbDataReader myRead = myCommand.ExecuteReader(); //开始读取
if(myRead.Read() == true)
{
Byte[] Buffer = (Byte[])myRead[0]; //输出
this.Response.Clear();
this.Response.ContentType = myRead[1].ToString();
this.Response.BinaryWrite(Buffer);
this.Response.End();
}