How to display mysql blob image in asp.net image control?

Micamu

New Member
I known the way to display the mysql blob image in Windows Forms. \[code\]try { MySqlConnection connection = new MySqlConnection(hp.myConnStr); MySqlCommand command = connection.CreateCommand(); MySqlDataReader Reader; command.CommandText = "select logo from mcs_institude where id = 1"; connection.Open(); Reader = command.ExecuteReader(); while (Reader.Read()) { pictureBox1.Image = new Bitmap(new MemoryStream((byte[])Reader.GetValue(0))); } connection.Close(); } catch(Exception ex) { MessageBox.Show("Error in Get_ImageFormDB"+ ex.Message, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); }\[/code\]But now i doing a asp.net project. In this image not have the image property,.\[code\]command = connection.CreateCommand(); command.CommandText = "Select FO_Roomdet_Image from fo_roomtype where FO_Roomdet_Id=1"; connection.Open(); Reader = command.ExecuteReader(); while (Reader.Read()) { Image1.ImageUrl = new MemoryStream((byte[])Reader.GetValue(0)); } connection.Close();\[/code\]When i try this in asp.net, it through an error.\[quote\] Error 1 Cannot implicitly convert type 'System.IO.MemoryStream' to 'string'\[/quote\]How Can i Solve this issue. and get mysql blob image just display in asp.net image control.help me please.
 
Back
Top