title: Return 2 values from function vb.net
body: <p>What I want is to return 2 values from the database with a function and then store the values in variables so I can work with them. This is my code.</p>
  
  <pre><code>Function Buscar_Registro(ByVal xId As Integer) As String
      Dim a, b As String
  
      'convertir cadena
      Dim Id As Integer
      Id = xId
  
      'conexión
      Dim Conexion As OleDbConnection = New OleDbConnection
      Conexion.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\Visual\2000Phrases\2000 Phrases.accdb"
  
      'cadena SQL
      Dim CadenaSQL As String = "SELECT * FROM Data WHERE Id = " &amp; Id
  
      'Adaptador
      Dim Adaptador As New OleDbDataAdapter(CadenaSQL, Conexion)
  
      'Data set
      Dim Ds As New DataSet
  
      'Llenar el Data set
      Conexion.Open()
      Adaptador.Fill(Ds)
      Conexion.Close()
  
      'Contar registro
      If (Ds.Tables(0).Rows.Count = 0) Then
          Return False
      Else
          a = Ds.Tables(0).Rows(0)("Nombre").ToString()
          b = Ds.Tables(0).Rows(0)("Apellido").ToString()
  
          Ds.Dispose()
          Return a
          Return b
          Return True
      End If
  
  
  End Function
  
  
  Private Sub Button1_Click_1(sender As Object, e As EventArgs) Handles Button1.Click
      Randomize()
      Dim value As Integer = CInt(Int((20 * Rnd()) + 1))
      TextBox3.Text = Buscar_Registro(value)
      TextBox4.Text = 
  End Sub
  </code></pre>
  
  <p>I dont' know how to do it. The function returns only the value of "a"
  Thanks</p>