Sunday, May 10, 2009

Retrieving only file name from sql server database not full path

If we upload a photo using upload control and insert into database and again we want to retrieve the file name then we use below code it will not display the full path it displays only file name


FileInfo fileN = new FileInfo(dr["Map_Attach"].ToString());
lbl_Map.Text = fileN.Name;

No comments: