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
leathu raj
NA
62
79.3k
Retrive images from local database(.sdf) to picturebox in c#
Jul 1 2014 6:45 AM
Hi,
Small help.... I need to get images from my local database(.sdf). I saved image into local database but i cant get it to my picturebox in my application. My codings are
string sql = "Select gift_img from gift_entry where gift_points = '" + comboBox_id.Text + "'";
if (conn.State != ConnectionState.Open)
conn.Open();
SqlCeCommand command = new SqlCeCommand(sql, conn);
command.CommandType = CommandType.Text;
command.ExecuteNonQuery();
SqlCeDataReader reader = command.ExecuteReader();
reader.Read();
if (reader.HasRows)
{
byte[] img = (byte[])(reader[0]);
if (img == null)
pictureBox1.Image = null;
else
{
MemoryStream ms = new MemoryStream(img);
pictureBox1.Image = Image.FromStream(ms);
}
}
this same coding was worked in sql database.. but this is not worked in local database...
Please Help me.....
Reply
Answers (
0
)
Silver Light with MVVM Data Pager Help
can any one help to navigate to home page on image button cl