Click here to Skip to main content
16,016,290 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have stored my image URL in table and retriving it in "image11"(shown below)

string image11 =ds.Tables[0].Rows[ctrl][4].ToString();

suggest some conversions for image(ex: for string 'ToString()')

sbtn.Image = (Image)(E:/ICON/ADD);// NOT WORKING

sbtn.Image=(..............).ToString; // NOT WORKING

sbtn.Image = image11.ToString // NOT WORKING
Posted
Comments
koool.kabeer 9-Aug-10 14:58pm    
what is the column type of your database?...
what is your application. web or windows..
koool.kabeer 9-Aug-10 14:58pm    
be cleared... let us know what is your problem exactly..

Try this one:

sbtn.Image =Image.FromFile(image11);


good luck
 
Share this answer
 
Hey,

Are you storing the entire image byte into database?

If so, just use

byte[] byteArrayIn = Encoding.UTF8.GetBytes(imagebyte)
MemoryStream ms = new MemoryStream(byteArrayIn);
Image returnImage = Image.FromStream(ms);
return returnImage;


If you are storing the url on the database use

string uri = ds.Tables[0].Rows[ctrl][4].ToString();
Image.FromFile(uri);
 
Share this answer
 
U can Try to convert the img to Bytes and then store it.
 
Share this answer
 
v2
ToString has brackets after it, it is a method. .ToString(). Your overall message is not clear, all that's clear is that you're very lost. What does 'not working' mean ? What errors do you get ? What are you trying to do ?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900