title: Value of type 'Integer' cannot be converted to 'System.Data.OleDb.OleDbDataReader'. vb.net
body: <p>i'm trying to read the last invoice number and display it in a textbox.....</p>
  
  <p>Assume that, Table name is "MyTable" , Column name is "InvoiceNumber" and it is AutoNumber, So it is Integers!</p>
  
  <p>Here's my code:</p>
  
  <pre><code>        Dim query As String = "SELECT MAX(InvoiceNumber) FROM MyTable"
          Dim cmd As New OleDb.OleDbCommand
          Dim reading As OleDb.OleDbDataReader
  
          cmd.CommandText = query
          cmd.Connection = conn
  
          reading = Convert.ToInt32(cmd.ExecuteScalar())
  
          If reading.Read Then
              TextBox1.Text = reading.Item("InvoiceNumber").ToString
          End If
  </code></pre>
  
  <p>Erorr is on "reading = Convert.ToInt32(cmd.ExecuteScalar())" because my Value is of type 'Integer' cannot be converted to 'System.Data.OleDb.OleDbDataReader'.</p>
  
  <p>Any help ... ?</p>