Código PHP:
       Private Sub Pacientes_Load(sender As Object, e As EventArgs) Handles MyBase.Load
 
        sql = "SELECT * FROM fpac"
        Cnn.Close()
        Cnn.Open()
 
        Try
            da = New SqlDataAdapter(sql, Cnn)
            'Llenamos la tabla con los datos leídos
            da.Fill(dt)
            totalpac = dt.Rows.Count - 1
 
            'Comprobamos que tengamos registros en la tabla
            If dt.Rows.Count < 1 Then
 
            Else
                Cargamos datos de clientes
                Cargadatos()
            End If
 
        Catch ex As Exception
            MsgBox(ex.ToString, MsgBoxStyle.Critical, "Error")
        Finally
            If Cnn.State = ConnectionState.Open Then
                Cnn.Close()
            End If
        End Try
 
    End Sub 
    Código PHP:
      Private Sub Refracción_Load(sender As Object, e As EventArgs) Handles MyBase.Load
 
        sql2 = "SELECT * FROM farchgra"
 
        Try
            darefrac = New SqlDataAdapter(sql2, Cnn)
 
            'Llenamos la tabla con los datos leídos
            darefrac.Fill(dtrefrac)
 
            datos_refraccion()
  
 
            'Comprobamos que tengamos registros en la tabla
            'If dtrefrac.Rows.Count < 1 Then
 
            'Else
            '    'Cargamos datos de clientes
            '    datos_refraccion()
            'End If
 
        Catch ex As Exception
            MsgBox(ex.ToString, MsgBoxStyle.Critical, "Error")
        Finally
            If Cnn.State = ConnectionState.Open Then
                Cnn.Close()
            End If
        End Try
 
    End Sub 
    
 

