Variable URLs from SQL Table

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2006
Posts: 143
Reputation: cutepinkbunnies is an unknown quantity at this point 
Solved Threads: 8
cutepinkbunnies's Avatar
cutepinkbunnies cutepinkbunnies is offline Offline
Junior Poster

Variable URLs from SQL Table

 
0
  #1
May 1st, 2006
Hello All,

I'm sure this is an easy one for you all, but pardon...I'm kinda new at this.

What I'm trying to do is store a URL in a SQL table using a text field. This is working successfully and as planned.

The heart of the issue:

I have 200 products, each have 4 different files to associate with that product (drawings...dwg, pdf, igs and dxf files) that I need to direct our users to.

I plan on placing all the files in the same directory so structure won't be a problem, and I hope to use the ['ProdNum'] value from the database to identify the filename via variable.

How would you suggest doing this in a feasable manner? I could type each url out (which is about 100 char ea) * 800 files = 8,000 characters (aka chances for a typo).

Is there a way I could copy/paste to each of the cells in the DB a script or a way of pulling the ['Prodnum'] value and inserting it into the <a href> statement?

<a href="down.xyz.com/['Products.ProdNum'].["Products.ColumnName']">['Products.ColumnName']</a> <-- something like that?

Jon
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 1,655
Reputation: tgreer is an unknown quantity at this point 
Solved Threads: 35
Team Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: Variable URLs from SQL Table

 
0
  #2
May 1st, 2006
Originally Posted by cutepinkbunnies
I plan on placing all the files in the same directory so structure won't be a problem, and I hope to use the ['ProdNum'] value from the database to identify the filename via variable.

How would you suggest doing this in a feasable manner? I could type each url out (which is about 100 char ea) * 800 files = 8,000 characters (aka chances for a typo).
When you say "How would you suggest doing this", what does the word "this" refer to? You already say you have a ProdNum field in some database table to refer to a filename. So... what's the question?

Type each URL out? Why? Where? You say the URL is already in the database.

Is there a way I could copy/paste to each of the cells in the DB a script or a way of pulling the ['Prodnum'] value and inserting it into the <a href> statement?
" Is there a way I could copy/paste to each of the cells in the DB a script" is not a meaningful sentence fragment.

"way of pulling the ['Prodnum'] value and inserting it into the <a href> statement? " Use a SQL query. Use the data retrieved to set the value of your Link object(s).

Sorry, you're going to need to be clearer and more specific.
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 143
Reputation: cutepinkbunnies is an unknown quantity at this point 
Solved Threads: 8
cutepinkbunnies's Avatar
cutepinkbunnies cutepinkbunnies is offline Offline
Junior Poster

Re: Variable URLs from SQL Table

 
0
  #3
May 2nd, 2006
Tgreer,

Thank you for your reply. I was a little unclear in the initial post.

Basically I have a SQL table which store some products, and in that table some of the columns are called PDF, DWG, IGS, DXF for the different drawings (for the engineers).

Basically, I'd like to make some kind of script that is ultra-low maintenance where our designers can add our products to the database and not have to worry about some big schindig of a URL. So is there a way I can setup a "default value" for the cell to be like the URL listed in my OP? That way its automatically displayed in my gridview control and as long as a file is there the user will be prompted to download.

I guess it wouldn't be that terrible to have to run the query every time a new product is added, it would just make my/everyone else's life easier .

Jon
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC