TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sai Yang
NA
136
27.4k
[C#] how to view image ????
May 2 2018 10:17 AM
I have already convert a picture box to byte then insert into database as image datatype.
The proble:
I need to preview it on to the picturebox again when datagrid cellclick event.
and I am using the following code:
string stimg = "select images from tb_employee where Boolean='True' and id='" + classinfo.eid + "'";
DataTable dtimg = ClassConnection.getdata(stimg, "tbname");
if (dtimg.Rows.Count == 1)
{
try
{
MemoryStream ms;
byte[] bviewimg = (byte[])dtimg.Rows[0]["images"];
ms = new MemoryStream(bviewimg);
ms.Seek(0, SeekOrigin.Begin);
picem.Image = Image.FromStream(ms);
}
catch
{
picem.Image = null;
}
}
this doesn't work for me .
What I can do next??
Any body has idea to solve this problem, please share it to me?>
thank you in advance.
Reply
Answers (
16
)
Dynamically load c# code from mssql databade
How to format decimal value upto 1 decimal place in mvc c#