Ver Mensaje Individual
  #2 (permalink)  
Antiguo 02/02/2015, 11:48
Monxu88
 
Fecha de Ingreso: agosto-2014
Mensajes: 44
Antigüedad: 12 años, 1 mes
Puntos: 0
Respuesta: El valor no puede ser nulo. dataTable (vb.net y Sql server)

Lo termino de solucionar poniendo esto...
Código PHP:
  Private Sub Refracción_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        sql2 
= "SELECT * FROM farchgra"
        
Cnn.Close()
        
Cnn.Open()

        Try
            
' darefrac = New SqlDataAdapter(sql2, Cnn)

            Dim cmd As New SqlCommand(sql2, Cnn)
            Dim darefrac As New SqlDataAdapter(cmd)
            Dim dtrefrac As New DataTable
            '
Llenamos la tabla con los datos leídos
            darefrac
.Fill(dtrefrac)


            
tot = dtrefrac.Rows.Count - 1
            
'Comprobamos que tengamos registros en la tabla
            If dtrefrac.Rows.Count < 1 Then

            Else
                '
Cargamos datos de clientes
                 datos_refraccion
()
                
TxtNum.Text = dtrefrac.Rows(1)("numero")
            
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 
Pero me tarda en cargar el formulario mas de 10segundos... cargando solamente un textbox...