Imports BDNotasAlumnos
Imports BDNotasAlumnos.DataSetBDNotasAlumnosTableAdapters
Imports System.Data

Class CProveedorDatosAlumno
  Private ds As DataSetBDNotasAlumnos
  Private ad As alumnosTableAdapter

  Public Sub New()
    ds = New DataSetBDNotasAlumnos()
    ad = New alumnosTableAdapter()
    ad.Fill(ds.alumnos)

    AddHandler ds.alumnos.alumnosRowChanged, AddressOf alumnos_FilaModificada
    AddHandler ds.alumnos.alumnosRowDeleted, AddressOf alumnos_FilaModificada
  End Sub

  Private Sub alumnos_FilaModificada(sender As Object, e As DataSetBDNotasAlumnos.alumnosRowChangeEvent)
    Try
      ad.Update(ds.alumnos)
    Catch ex As System.Data.SqlClient.SqlException
      System.Windows.MessageBox.Show(ex.Message)
    End Try
  End Sub

  Public Function ObtenerAlumnos() As DataView
    Return ds.alumnos.DefaultView
  End Function
End Class
