Click here to Skip to main content
13,046,773 members (56,494 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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);

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 ??

Posted 20-Apr-13 23:06pm
Updated 21-Apr-13 3:18am
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
Please Sign up or sign in to vote.

Solution 1

and assign path to it!

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
Web02 | 2.8.170713.1 | Last Updated 21 Apr 2013
Copyright © CodeProject, 1999-2017
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