title: How to add list of strings to Database C#
body: <p>I have list like this:</p>
  
  <pre><code>var list = new List&lt;string&gt;();
  </code></pre>
  
  <p>This list contains lets say following names: "Ken", "John", "Tom", etc. </p>
  
  <p>I need to add this list to database table which looks like this:</p>
  
  <pre><code>Id          SecondId              Name
  1           1                     Ken
  2           1                     John
  3           2                     Tom
  </code></pre>
  
  <p>Where SecondId is secondary key and that info i already have. But my question is there a better way of adding all names to the database without iterating through list using foreach loop? Any linq query or some other way or i have to iterate through the list to add them to database one by one?</p>