title: C# Reading SQL tables and views
body: <p>I'm currently reading in a list of tables in a SQL database and populating a comboBox with the table names. I want to include SQL Views in the same list. The sysobjects type for tables is 'U' and for views it's 'V'. How would I alter the OdbcCommand line to retrieve both U and V? Thanks.</p>
  
  <pre><code>OdbcConnection cn=getConnection(); 
  OdbcCommand cmdList; 
  cmdList = new OdbcCommand("select name, user_name(uid) from sysobjects where type='U'",cn);
  cn.Open();
  
          OdbcDataReader reader = cmdList.ExecuteReader();
          while (reader.Read())
          {
              for (int i=0;i&lt;reader.FieldCount;i++)
              {
                  if (!reader.IsDBNull(i))
                  {
                      if (reader.GetName(i).ToUpper()=="NAME")
                      {
                              comboBoxTables.Items.Add(reader.GetString(i));
                      }
                  }
              }
          }
  cn.Close();
  </code></pre>