Trabajos

Solo disponible en BuenasTareas
  • Páginas : 2 (333 palabras )
  • Descarga(s) : 0
  • Publicado : 10 de febrero de 2011
Leer documento completo
Vista previa del texto
Public ds As DataSet
Public dt As DataTable
Public da As SqlDataAdapter
Public filas As Integer
Dim fila As Integer = 0
Public miReader As SqlDataReader
Public cmd AsSqlCommand
Public TipoBusqueda As Char
Public TipoOperacion As Char

Public numero As String

Sub llenardataset()
Dim cadena As String
ds = New DataSet()cadena = "SELECT age_codigo,age_direccion,age_departamento,age_ciudad,age_telefono FROM tbl_agencia" ' order by age_codigo"
da = New SqlDataAdapter(cadena, conexion)
da.Fill(ds,"dtagencia")' //fill para ienar el ds y le asigan un nomnbre dtprrod
dt = ds.Tables(0)
filas = Val(dt.Rows.Count)
mostrar()

End Sub

Sub mostrar()
Dimdr As DataRow
dr = dt.Rows(fila)
' para mostrar la cantidad de registros
lbl1.Text = "Registro " & fila + 1 & " de " & dt.Rows.Count
'''''txtcodigo.Text = dr("age_Codigo").ToString()
txtdireccion.Text = dr("age_direccion").ToString
txtdepa.Text = dr("age_departamento").ToString()
txtciudad.Text =dr("age_ciudad").ToString()
txttelefono.Text = dr("age_telefono").ToString()
conexion.Close()
End Sub

Private Sub frmagencia_Activated(ByVal sender As Object, ByVal e AsSystem.EventArgs) Handles Me.Activated
frmagencia.ActiveForm.Height = 306
frmagencia.ActiveForm.Width = 448
End Sub

Private Sub frmagencia_Load(ByVal sender As System.Object, ByVal eAs System.EventArgs) Handles MyBase.Load

llenardataset()
mostrar()

End Sub

Private Sub btnPrimero_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles btnPrimero.Click
fila = 0
mostrar()
End Sub

Private Sub btnAnterior_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAnterior.Click...
tracking img