Is there any way to turn multiple paths from a DB field into separate href links? eg:
c:\MyPath\SomeFile.pdf;c:\MyPath\AnotherFile.pdf;c:\MyPath\LastFile.pdf
I'm able to program a single path above into a link but the SQL DB I'm using could have up to 3 separate paths to files in it.
So for example I can turn this:
c:\MyPath\SomeFile.pdf
Into this link (and make it clickable):
\\1.1.1.1\c$\MyPath\SomeFile.pdf
I'm currently able to do this by creating a few variables to hold the path and the data from the field:
string UNCPath = "\\\\1.1.1.1\\c$\\";
string PathToFile = (dgv[e.ColumnIndex, e.RowIndex].Value.ToString());
System.Diagnostics.Process.Start(temp1 + temp2);
Some additional notes on the above:
- I also change the colon to dollar
- Of course the IP and path etc are fake
The problem is that I'm not sure what to do if the field has multiple fields.
I'm thinking a right click menu that shows all 3 (or 2 or 1) paths and make them clickable.
Or I'd have to open another form page listing them....similar to the above line.
These methods don't seem like a very good approach to me.
Is there any other decent way to do this?