Click here to Skip to main content
12,068,967 members (65,951 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP.NET
i'm having a problem, in displaying the image in the imagebox. i'm having the following fields in my table User:
1 user name
2 email- primary key
3 age
4 password
5 image_name
6 image_path
and the folder in which the image is saved named - User_Pic.

now, i have saved the image name and path in the database using the following code:
FileUpload.PostedFile.SaveAs(Server.MapPath("~/User_Pic/") + FileUpload.FileName.ToString());
string Filename = Path.GetFileName(FileUpload.PostedFile.FileName);
 
string sql = "insert into User_Table values('" + txtUser_Name.Text + "','" + txtEmail_Id.Text + "','" +  txtAge.Text + "','" + txtPassword.Text + "','" + Filename + "','" + "User_Pic/"+Filename + "')";
 
ob.cmd = new System.Data.SqlClient.SqlCommand(sql, ob.con);
ob.cmd.ExecuteNonQuery();
lblInfo.Text = "REGISTERED SUCCESSFULLY";
Now how to display it in image box using the query as email id:
string sql = "select Image_Path from User_Table where Email_Id = ('" + TextBox1.Text + "')";
after this i'm having the trouble ??

PLEASE HELP
Posted 21-Apr-13 0:06am
nrgupta266
Edited 21-Apr-13 4:18am
v2
Comments
ThePhantomUpvoter 21-Apr-13 5:43am
   
"after this i'm having the trouble", and what exactly would that trouble be?

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

use
picturebox.ImageLocation="your_image_path";
and assign path to it!
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web04 | 2.8.160208.1 | Last Updated 21 Apr 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100