Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/09/2009, 20:26
xDriver
 
Fecha de Ingreso: septiembre-2009
Mensajes: 73
Antigüedad: 15 años, 5 meses
Puntos: 0
DataSet tipado - no me muestra ningun dato

He creado un dataset tipado enlazado a SQLServer2005 segun la info del guille
elguille.info/NET/ADONET/base_sql_asistente_express.htm

El resultado es este, revisen la imagen esta todo ok
img.tomatone.net/big/dataset.png

Ahora intento visualizar datos atravez de este ejemplo pero no ocurre nada, no
se genera ningun error solo me muestra el mensaje "Se termino el ejemplo" donde puedo estar fallando.

Código:
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Try
            Dim MiSqlConnection As New SqlConnection("Data Source=.\SQLEXPRESS; Initial Catalog=ventas; Integrated Security=True")

            Dim MiSqlDataAdapter As New SqlDataAdapter("SELECT*FROM categoria", MiSqlConnection)
            Dim MiDtTyped As New ventasDataSet
            MiSqlDataAdapter.Fill(MiDtTyped, "ejemplo")
            Dim MisDatos As ventasDataSet.CategoriaRow
            For Each MisDatos In MiDtTyped.Categoria
                MessageBox.Show(MisDatos.CodCat & " " & MisDatos.NomCat)
            Next
            MsgBox("Termino el ejemplo")
        Catch
            MsgBox("error")
        End Try
    End Sub
En la bd tengo varios registros, por que no me muestra la informacion?, la conexion es la misma en el dataset y en el codigo
Data Source=.\SQLEXPRESS; Initial Catalog=ventas; Integrated Security=True

saludos