list - Send some pdf files as email attachments stored in a db in c# -


i need send pdf files email attachments stored in database.

enter image description here

i need convert comma separated string list<string> , have tried c# code:

if (reader.hasrows) {     while (reader.read())     {         recoveryatt = reader["att"].tostring();                                                                                string commaseplist;         string[] itemlist = { recoveryatt.tostring() };         commaseplist = string.join("; ", itemlist);         response.write(commaseplist.tostring());      } } 

but in output have:

d:\inetpub\wwwroot\app\public\015.pdfd:\inetpub\wwwroot\app\public\016.pdfd:\inetpub\wwwroot\app\public\017.pdfd:\inetpub\wwwroot\app\public\018.pdfd:\inetpub\wwwroot\app\public\019.pdf 

and in email attachment first pdf file...

this doesn't work cause returns string[] without separator.

please help.

i think trick

string[] itemlist = regex.split(recoveryatt, @"(?=d:)").where(x => !string.isnullorempty(x)).toarray(); commaseplist = string.join("; ", itemlist); response.write(commaseplist); 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -