Dear All
I added below code onto Photo Load Click Event. Photo is added but Size is not Actual. So, How to fixed size. I am managing Path but How to retrieve Image from Database.
string path = null;
OpenFileDialog fileDialog = new OpenFileDialog();
fileDialog.ShowDialog();
path = fileDialog.FileName;
txtPhotoID.Text = path;
PictureBox picBox = new PictureBox();
picBox.Image = new Bitmap(fileDialog.FileName);
picImage.Controls.Add(picBox);
picBox.Height = 300;
picBox.Width = 400;
picBox.BackgroundImageLayout = ImageLayout.Zoom;
OpenFileDialog fileDialog = new OpenFileDialog();
fileDialog.ShowDialog();
path = fileDialog.FileName;
txtPhotoID.Text = path;
PictureBox picBox = new PictureBox();
picBox.Image = new Bitmap(fileDialog.FileName);
picImage.Controls.Add(picBox);
picBox.Height = 300;
picBox.Width = 400;
picBox.BackgroundImageLayout = ImageLayout.Zoom;

Dipankar BiswasRank #992 · 2K reputationPosted Aug 18, 2014, 2:05 AM EDT
Ankur JainRank #2,475 · 567 reputationPosted Aug 18, 2014, 2:11 AM EDT
see below thread...
http://www.msdotnet.co.in/2014/04/how-to-save-image-in-database-and.html#.U_HRJfmSzcg
Abhijit PatilRank #700 · 3.4K reputationPosted Aug 18, 2014, 2:42 AM EDT
there is no need to set size to picturebox used the property of picturebox sizemode="Strech"
it is automatically set in size.
for upload the image write the following code in the upload button click
for fetch images from the database
decalre the
byte[] data;
and write the following code for get image from database and show in picturebox
hope it helps
PRASANTA BISWAS26 reputationPosted Aug 18, 2014, 5:17 AM EDT
thanks for reply. Actually I declared in database PhotoID as NVARCHAR(100). Because I am Saving Only Path. So How would I show.
Need your Help.