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
anamika panday
NA
3
1.3k
call image into grid view
Apr 22 2013 6:56 AM
hello,
i m doing project in c#.net iput path of image into database(sqlserver),and fetch those image from database into gridview...
i use to write this code as.
SqlDataReader rdr = dal.ExecuteReader("select image from studentreg where eventname like '%" + lblheading.Text + "%'", ref message);
if (rdr.HasRows)
{
string imgpath;
rdr.Read();
DataGridViewRow dgvr = new DataGridViewRow();
imgpath = rdr.GetString(0);
Image newimg = Image.FromFile(imgpath);
DataGridViewImageColumn ic = new DataGridViewImageColumn();
ic.Image = newimg;
ic.Name = "image";
ic.HeaderText = "image";
dgvr.Cells[0].Value = newimg;
dgv.Rows.Add(dgvr);
dgv.Columns.Insert(0, ic);
}
if (dt != null && dt.Rows.Count > 0)
{
dgv.DataSource = null;
dgv.DataSource = dt;
Point p = new Point(Screen.PrimaryScreen.WorkingArea.Width / 2 - this.Width / 5, Screen.PrimaryScreen.WorkingArea.Height / 2 - this.Height / 4);
this.Location = p;
}
else
{
dgv.DataSource = null;
MessageBox.Show("No any Registration...!");
}
plz help me out
Reply
Answers (
2
)
Rectangle with negative height
while crystalreport is load every time asking database login