Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to store url and file path in database in asp.net

Status
Not open for further replies.

jamin20

Programmer
Feb 13, 2012
14
0
0
CH
Hi all
I need to save the links of some attachements.
These links can be either URL (fileupload control) or Filepath (copy/paste in textbox).
Shall I store URL and FilePath in same field of the same table and render them in the same grid or not ?
Piece of advice + piece of code would be higly appreciated.
Jamin
 
I'm not sure what you are trying to do. Saving the URL in a "URL" column makes sense, because if it is an image, you can show the image in a grid, repeater, or what ever control. Storing a file path doesn't make sense unless it is the file path on the server. You won't be able to render say, an image, from a local machine running the page.
Since I don't know exactly what your page is doing, I would say just create one column in your table to store the URL / Filepath.
 
Hi,
thx for your answer.
What I try to do is:
- to store information related to attachments (can be a file or a url)
- to display the links (listed in a grid) that when clicked will displayed (in a separate window) the corresponding attachment.
My idea is to save the links in a table, when user clicks a link which is:
- a URL then the webpage is opened
- a file path or path server then the file is displayed.
thx
Jamin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top