Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
foreach (HttpPostedFile postedFile in fudoc.PostedFiles)
                   {

                            doc = Path.GetFileName(postedFile.FileName);

               postedFile.SaveAs(System.IO.Path.Combine(Server.MapPath("~/Document/"), doc));

                           docName += String.Format("{0}", doc);


                   }



//string insert query..... //please help me out. how to insert multiple files in single column in database as a hyperlink. //thanks
Posted

1 solution

Store all the link as comma separated in a column, while fetch break the string based on comma.
 
Share this answer
 
Comments
Bunty Arslan 7-Nov-14 1:02am    
docName += String.Format("{0}<br/>", doc);
like this ?
Mukesh Ghosh 7-Nov-14 1:05am    
no, this way docName += ","+String.Format("{0}", doc);
Once complete docName prepared, remove last "," before insert in DB by trim function
Bunty Arslan 7-Nov-14 1:11am    
insert into table (document) values('"+docname.trim(,)+"');
like this?
Mukesh Ghosh 7-Nov-14 1:14am    
Please debug first & see what docname contain before asking small steps.
Bunty Arslan 7-Nov-14 1:18am    
,doc1.docx,doc2.docx
docname contains this.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900