G
Guest
Hi,
I created a table with a field to store the full path of the uploading images
The table scheme is
i
path //path to the uploading imag
userid //who upload i
Now, I want to display the image path in url, it only shows the images belong to that user. User can see that image by clicking the hyperlink
Here is the code
[code
protected System.Web.UI.WebControls.HyperLink lnkAttachement
private string GetPath(int id
string sql
SqlDataReader dr
sql = "Select path From upload Where userid='" + id.ToString() + "'"
tr
dr = SqlHelper.ExecuteReader(Connection,System.Data.CommandType.Text,sql)
if(dr.Read()
this.lnkAttachement.Text = Path.GetFileName(dr["path"].ToString())
this.lnkAttachement.NavigateUrl = stringDirectory + Server.UrlEncode(Path.GetFileName(dr["path"].ToString()))
els
dr.Close()
catc
[/code
dr.Read() cannot read the whole table and put them to the url.
How should I write it
Thanks for help
I created a table with a field to store the full path of the uploading images
The table scheme is
i
path //path to the uploading imag
userid //who upload i
Now, I want to display the image path in url, it only shows the images belong to that user. User can see that image by clicking the hyperlink
Here is the code
[code
protected System.Web.UI.WebControls.HyperLink lnkAttachement
private string GetPath(int id
string sql
SqlDataReader dr
sql = "Select path From upload Where userid='" + id.ToString() + "'"
tr
dr = SqlHelper.ExecuteReader(Connection,System.Data.CommandType.Text,sql)
if(dr.Read()
this.lnkAttachement.Text = Path.GetFileName(dr["path"].ToString())
this.lnkAttachement.NavigateUrl = stringDirectory + Server.UrlEncode(Path.GetFileName(dr["path"].ToString()))
els
dr.Close()
catc
[/code
dr.Read() cannot read the whole table and put them to the url.
How should I write it
Thanks for help