Abhilash J A

Abhilash J A

  • 524
  • 2.4k
  • 600.8k

How can I use foreach loop in c# ?

Dec 20 2016 10:53 AM
Hello everyone,
 
I have list of this items. The jpgFilesNames object contain,
 
 
And want to save this items to table.
 
But now saving like this,
 
 
 
I want to save 001,002 to like that... 
 
I have tried this.
 
  1. foreach (var item in jpgFilePath)  
  2.            {  
  3.                foreach (var item1 in jpgFilesNames)  
  4.                {  
  5.                    parrentName = item1.Split('_')[0];  
  6.                    childName = item1.Split('_')[1];  
  7.                    objTble_Documents.Parent_File_Name = parrentName;  
  8.                    objTble_Documents.Child_File_Name = childName;  
  9.                    objTble_Documents.FilePath = item;  
  10.                    service.AddScanDocuments(objTble_Documents);  
  11.                }  
  12.            }  
 
How can I do that?
 
 

Answers (1)