FANDOM


Lista de soportes Editar

Imports System
Imports System.Data.Odbc

Module Main
  Sub Main()

    Dim sCon As String
    sCon = "DSN=Videoteca"
    Dim oCon As New OdbcConnection
    oCon.ConnectionString = sCon
    oCon.Open
    
    Dim sCmd As String
    sCmd = "SELECT * FROM soporte"
    Dim oCmd As New OdbcCommand
    oCmd.Connection = oCon
    oCmd.CommandText = sCmd
    
    Dim oReader As OdbcDataReader
    oReader = oCmd.ExecuteReader
    
    Dim sId As string
    Dim sNombre As String
    Dim sDesc As String
    
    While oReader.Read
    
      sId = oReader.GetString(0)
      sNombre = oReader.GetString(1)
      sDesc = oReader.GetString(2)
      Console.Write("("+sId+") ")
      Console.Write(sNombre+": ")
      Console.WriteLine(sDesc+".")
    
    End While

  End Sub
End Module