title: Iterating through every column name in a table one at a time
body: <p>I have a series of excel documents all with different structures that i am trying to import into a SQL database. The solution i have come up with is to get the user to map the columns in the spreadsheet with the columns in the database. The problem i am having is getting the database column names one at a time, i can get them all at once with the following SQL command in Microsoft SQL Server Management Studio but i can for the life of me get it to iterate through them and i have no idea how i would translate this to vb.net.</p>
  
  <pre><code>SELECT [name] AS [Column Name]
  FROM syscolumns
  WHERE id = (SELECT id FROM sysobjects WHERE type = 'U' AND [Name] = 'table1')
  </code></pre>
  
  <p>I currently have the user selecting the spreadsheet column from a Listbox and i want the database column to appear in a Label above it so when the user hits next i can just reset the Listbox and move to the next database column while mapping the two column names in a two dimensional array.</p>