Set DataValue from Code-behind?

2 posts, 1 answers
  1. Rakesh
    Rakesh avatar
    1 posts
    Member since:
    Oct 2011

    Posted 01 Nov 2011 Link to this post

    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 ...
  2. Answer
    Tsvetina avatar
    1861 posts

    Posted 02 Nov 2011 Link to this post

    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,
    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
  3. DevCraft R3 2016 release webinar banner
Back to Top