Ver Mensaje Individual
  #7 (permalink)  
Antiguo 17/03/2012, 11:10
CarlosMelgar
 
Fecha de Ingreso: febrero-2012
Mensajes: 44
Antigüedad: 12 años, 3 meses
Puntos: 0
Respuesta: Instancia un procedimiento almacenado

Bueno hice click como dijiste y me llevo a este código.

Código vb:
Ver original
  1. <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
  2.          Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0"),  _
  3.          Global.System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")>  _
  4.         Public Overloads Overridable Function ContarClientes() As Object
  5.             Dim command As Global.System.Data.SqlClient.SqlCommand = Me.CommandCollection(2)
  6.             Dim previousConnectionState As Global.System.Data.ConnectionState = command.Connection.State
  7.             If ((command.Connection.State And Global.System.Data.ConnectionState.Open)  _
  8.                         <> Global.System.Data.ConnectionState.Open) Then
  9.                 command.Connection.Open
  10.             End If
  11.             Dim returnValue As Object
  12.             Try
  13.                 returnValue = command.ExecuteScalar
  14.             Finally
  15.                 If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then
  16.                     command.Connection.Close
  17.                 End If
  18.             End Try
  19.             If ((returnValue Is Nothing)  _
  20.                         OrElse (returnValue.GetType Is GetType(Global.System.DBNull))) Then
  21.                 Return Nothing
  22.             Else
  23.                 Return CType(returnValue,Object)
  24.             End If
  25.         End Function

Gracias por la paciencia y si no es ese no se cual mas

pues lo unico que hice luego de hacer el procedimiento fue
colocar dentro evento click del label1
Código vb:
Ver original
  1. Me.ClientesTableAdapter.ContarClientes()