像我想表明從數據庫二進制數據(圖像),而不使用處理器顯示從數據庫
var imgLogo = cid.Tables[0].Rows[0]["Logo"].ToString();
可以請你建議我做的方式。這裏是我的aspx內容
如何從代碼隱藏設置IMAGEURL?我已經嘗試過一個,但它不能正常工作
Byte[] bytes = (Byte[])cid.Tables[0].Rows[0]["Logo"];
Response.Buffer = true;
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "image/jpg";
Response.BinaryWrite(bytes);
我該如何設置imageUrl?
在此先感謝。
***哪些數據庫的***樣的? MySQL的?甲骨文? DB2? SQL Server? Postgres的?別的東西? –
也許你可以檢查一會兒: http://www.aspsnippets.com/articles/display-images-from-sql-server-database-in-asp.net-gridview-control.aspx – Krekkon
它的sql服務器,@Krekkon - 我試過,但是這個例子是用處理程序類創建的。 – kiran