This is a migrated thread and some comments may be shown as answers.

Set DataValue from Code-behind?

1 Answer 118 Views
BinaryImage
This is a migrated thread and some comments may be shown as answers.
Rakesh
Top achievements
Rank 1
Rakesh asked on 01 Nov 2011, 12:22 PM
I have a dataset ds which contains Image which i want to display , look at the code below

int uid = int.Parse(Session["UserId"].ToString());
ds = new DataSet();
string urprofile = "SELECT * FROM [Mimage] WHERE UID=" + uid + "";
ds = dbClass.ReturnDS(urprofile);
var image = ds.Tables[0].Rows[0]["Image"];
Thumbnail.DataValue =(byte[])image;
However this throws an error which i am attaching ...
Help..??

1 Answer, 1 is accepted

Sort by
0
Accepted
Tsvetina
Telerik team
answered on 02 Nov 2011, 01:57 PM
Hi Rakesh,

As long as you pass the RadBinaryImage control a valid byte array, it will display it. I am attaching a sample project showing how the control is populated by reading a binary image from the database. Can you replicate the same issue inside it, with the sample Telerik database? 

All the best,
Tsvetina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
BinaryImage
Asked by
Rakesh
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or