title: Getting the error "Expression does not produce a value
body: <p>I am relatively new to using visual basic and I am having a problem populating a list box from a database. The error that comes up is Expression does not produce a value. </p>
  
  <p>Here is the code from My form:</p>
  
  <pre><code>Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
      'Populate Blu Ray and DVD listboxes
  
      Dim objMovies As New clsMovies
  
      objMovies.Select_BR_List()
      objMovies.Select_Dvd_List()
  
      For Each strBluRay As String In objMovies.Select_BR_List
          lstBluRay.Items.Add(strBluRay)
      Next
  
      For Each strDVD As String In objMovies.Select_Dvd_List
          lstDvd.Items.Add(strDVD)
      Next
  End Sub
  </code></pre>
  
  <p>And here's the code from the class:</p>
  
  <pre><code>Public Sub Select_Dvd_List()
      Dim objConnection As New SqlCeConnection(mstrCN)
  
      'Create SQL statement
      mstrSQL = "Select * from Dvd"
      'Instantiate command
      Dim objCommand As New SqlCeCommand(mstrSQL, objConnection)
  
      'open Database
      objCommand.Connection.Open()
  
      'Instantiate Data Reader
      Dim objDataReader As SqlCeDataReader
  
      'Execute SQL
      objDataReader = objCommand.ExecuteReader()
  
      'read Sql results
      Do While (objDataReader.Read)
          mlstDvd.Add(objDataReader.Item("dvdTitle").ToString)
      Loop
  
      'Close 
      objCommand.Dispose()
      objDataReader.Close()
      objDataReader.Dispose()
      objConnection.Close()
      objConnection.Dispose()
  End Sub
  </code></pre>