title: String conversion for SQL select statement
body: <p>Using a SELECT statement I query a database and get back a result in the format: name1,name2,name3</p>
  
  <p>Depending on the database entry this result could have any number of names: name1,name2...name(n)  </p>
  
  <p>I would like to use this data to query another database like so:</p>
  
  <pre><code>SELECT Name, SerialNo, Model FROM InstrumentTable where ID=1 and InstName IN name1,name2,name3
  </code></pre>
  
  <p>In order to do this I need to convert name1,name2,name3 to ('name1','name2','name3')</p>
  
  <p>I have tried splitting the String into an array of Strings</p>
  
  <pre><code>    Dim ref1s As String = cmdf1.ExecuteScalar()
      Dim fields() As String = Nothing
      fields = ref1s.Split(",")
  </code></pre>
  
  <p>and then concatenating them in an array</p>
  
  <pre><code>For i As Integer = 0 To fields.Count - 1
       MsgBox(String.Concat("'", fields(i), "'"))
   Next
  </code></pre>
  
  <p>but I haven't been able to figure out how to do it yet.</p>
  
  <p>Adding the brackets at the start and end of the string shouldn't be a problem just adding the quotes to each name and separating them with a comma is the issue.</p>
  
  <p>Can anyone help me with this?</p>