none
Referencia a objeto no establecida como instancia de un objeto. VB .NET RRS feed

  • Pregunta

  • antes que nada muchas gracias por leer mi pregunta.. me encontre un post con el mismo  tema  pero  aun asi no  he podido  resolverlo , e buscado en muchso foros pero me cuesta trabajo entender la logica   ya que estoy aprendiendo

    ojala me puedan orientar

    tengo  2 formas    la primera es solo para abrir  otras formas

    Public Class frm_security
        Private Sub actualizar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles actualizar.Click
            Select Case Opcion
                Case "fpedimentos"
                    If txtPassword.Text.ToString = "poarboledas" Or txtPassword.Text.ToString = "POARBOLEDAS" Then
                        Me.Visible = False
                        Dim fpedimentos As New frm_pedimentos
                        fpedimentos.ShowDialog()
                        Me.Close()
                    Else
                        Me.Close()
                    End If
                Case "fmovimientos"
                    If txtPassword.Text.ToString = "poarboledas" Or txtPassword.Text.ToString = "POARBOLEDAS" Then
                        Me.Visible = False
                        Dim fmovimientos As New Frm_movimientos
                        fmovimientos.ShowDialog()
                        Me.Close()
                    Else
                        Me.Close()
                    End If
                Case "fprecioslinea"
                    If txtPassword.Text.ToString = "casa140641" Or txtPassword.Text.ToString = "CASA140641" Then
                        Me.Visible = False
                        Dim fprecioslinea As New frm_actualizaprecios
                        fprecioslinea.ShowDialog()
                        Me.Close()
                    Else
                        Me.Close()
                    End If
                Case "fprecios"
                    If txtPassword.Text.ToString = "poarboledas" Or txtPassword.Text.ToString = "POARBOLEDAS" Then
                        Me.Visible = False
                        Dim fprecios As New frm_precios
                        fprecios.ShowDialog()
                        Me.Close()
                    Else
                        Me.Close()
                    End If
                Case "fupdatelineas"
                    If txtPassword.Text.ToString = "poarboledas" Or txtPassword.Text.ToString = "POARBOLEDAS" Then
                        Me.Visible = False
                        Dim fupdatelineas As New frm_updatelineas
                        fupdatelineas.ShowDialog()
                        Me.Close()
                    Else
                        Me.Close()
                    End If
                Case "fsugerido"
                    If txtPassword.Text.ToString = "poarboledas" Or txtPassword.Text.ToString = "POARBOLEDAS" Then
                        Me.Visible = False
                        Dim fsugerido As New frm_sugerido
                        fsugerido.ShowDialog()
                        Me.Close()
                    Else
                        Me.Close()
                    End If
                Case "fpomaker"
                    If txtPassword.Text.ToString = "poarboledas" Or txtPassword.Text.ToString = "POARBOLEDAS" Then
                        Me.Visible = False
                        Dim fpomaker As New frm_POmaker
                        fpomaker.ShowDialog()
                        Me.Close()
                    Else
                        Me.Close()
                    End If
                Case "fpuntoreorden"
                    If txtPassword.Text.ToString = "poarboledas" Or txtPassword.Text.ToString = "POARBOLEDAS" Then
                        Me.Visible = False
                        Dim fptoreorden As New frm_PuntoReorden
                        fptoreorden.ShowDialog()
                        Me.Close()
                    Else
                        Me.Close()
                    End If
                Case "fguias"
                    If txtPassword.Text.ToString = "crmarboledas" Or txtPassword.Text.ToString = "CRMARBOLEDAS" Then
                        Me.Visible = False
                        Dim fguias As New Frm_Guias
                        fguias.ShowDialog()
                        Me.Close()
                    Else
                        Me.Close()
                    End If
                Case "fubicaciones"
                    If txtPassword.Text.ToString = "whsarboledas" Or txtPassword.Text.ToString = "WHSARBOLEDAS" Then
                        Me.Visible = False
                        Dim fubicaciones As New frm_ubicaciones
                        fubicaciones.ShowDialog()
                        Me.Close()
                    Else
                        Me.Close()
                    End If
                Case "foliosf"
                    If txtPassword.Text.ToString = "barboledas" Or txtPassword.Text.ToString = "BARBOLEDAS" Then
                        Me.Visible = False
                        Dim foliosf As New frm_foliosF
                        foliosf.ShowDialog()
                        Me.Close()
                    Else
                        Me.Close()
                    End If
                Case "cfd"
                    If txtPassword.Text.ToString = "cfdarboledas" Or txtPassword.Text.ToString = "CFDARBOLEDAS" Then
                        Me.Visible = False
                        Dim cfd As New frm_CFD
                        cfd.ShowDialog()
                        Me.Close()
                    Else
                        Me.Close()
                    End If
                Case "foliosnc"
                    If txtPassword.Text.ToString = "ncarboledas" Or txtPassword.Text.ToString = "NCARBOLEDAS" Then
                        Me.Visible = False
                        Dim foliosnc As New frm_FoliosNC
                        foliosnc.ShowDialog()
                        Me.Close()
                    Else
                        Me.Close()
                    End If
                Case "foliosca"
                    If txtPassword.Text.ToString = "caarboledas" Or txtPassword.Text.ToString = "CAARBOLEDAS" Then
                        Me.Visible = False
                        Dim foliosca As New frm_FoliosCA
                        foliosca.ShowDialog()
                        Me.Close()
                    Else
                        Me.Close()
                    End If

                Case "fpostfechados"
                    If txtPassword.Text.ToString = "crarboledas" Or txtPassword.Text.ToString = "CRARBOLEDAS" Then
                        Me.Visible = False
                        Dim cobranza As New frm_cobranza
                        cobranza.ShowDialog()
                        Me.Close()
                    Else
                        Me.Close()
                    End If
                Case "fresumenvtas"

                    If txtPassword.Text.ToString = "soarboledas" Or txtPassword.Text.ToString = "SOARBOLEDAS" Then
                        Me.Visible = False
                        Dim fresumenvtas As New frm_resumenvtas
                        fresumenvtas.ShowDialog()
                        Me.Close()
                    Else
                        Me.Close()
                    End If
                Case "freptlmk"
                    If txtPassword.Text.ToString = "soarboledas" Or txtPassword.Text.ToString = "SOARBOLEDAS" Then
                        Me.Visible = False
                        Dim freportes As New Rep_Telemarketing
                        freportes.ShowDialog()
                        Me.Close()
                    Else
                        Me.Close()
                    End If
                Case "fatraso"
                    If txtPassword.Text.ToString = "crarboledas" Or txtPassword.Text.ToString = "CRARBOLEDAS" Then
                        Me.Visible = False
                        Dim fatraso As New frm_Atraso
                        fatraso.ShowDialog()
                        Me.Close()
                    Else
                        Me.Close()
                    End If
                Case "fcomisiones"
                    If txtPassword.Text.ToString = "crarboledas" Or txtPassword.Text.ToString = "CRARBOLEDAS" Then
                        variable = 1
                        Me.Visible = False
                        Dim fatraso As New frm_Comisiones1
                        frm_Comisiones1.ShowDialog()
                        Me.Close()
                    ElseIf txtPassword.Text.ToString = "crcomisiones" Or txtPassword.Text.ToString = "CRCOMISIONES" Then
                        variable = 2
                        Me.Visible = False
                        Dim fatraso As New frm_Comisiones1
                        frm_Comisiones1.ShowDialog()
                        Me.Close()
                    Else
                        Me.Close()
                    End If


                Case "envio_cfd"
                    If txtPassword.Text.ToString = "enviocfdar" Or txtPassword.Text.ToString = "ENVIOCFDAR" Then
                        variable = 1
                        Cad_Conexion = "data source =DataServer; Initial Catalog = SBOArboledas2012A; Language=Spanish; user = sa; password =sa; Connect Timeout=3600"
                        Me.Visible = False
                        Dim fenviocfd As New frm_EnvioCFD
                        frm_EnvioCFD.ShowDialog()
                        Me.Close()

                    ElseIf txtPassword.Text.ToString = "enviocfdac" Or txtPassword.Text.ToString = "ENVIOCFDAC" Then
                        variable = 2

                        Cad_Conexion = "data source =DataServer; Initial Catalog = ACRefacciones; Language=Spanish; user = sa; password =sa; Connect Timeout=3600"
                        Me.Visible = False
                        Dim fenviocfd As New frm_EnvioCFD
                        frm_EnvioCFD.ShowDialog()
                        Me.Close()

                    Else
                        Me.Close()
                    End If

                Case "informe_sat"


                    If txtPassword.Text.ToString = "informesatar" Or txtPassword.Text.ToString = "INFORMESATAR" Then
                        Me.Visible = False
                        Dim finformesat As New Informe_mensualCFD
                        Informe_mensualCFD.ShowDialog()
                        Me.Close()
                    Else
                        Me.Close()
                    End If
                Case "Captura Cuotas"
                    'If txtPassword.Text.ToString = "ventas" Or txtPassword.Text.ToString = "VENTAS" Then
                    If txtPassword.Text.ToString = "soarboledas" Or txtPassword.Text.ToString = "SOARBOLEDAS" Then
                        Me.Visible = False
                        Dim CapturaCuotas As New MenuCapturaCuotas
                        MenuCapturaCuotas.ShowDialog()
                        Me.Close()
                    Else
                        Me.Close()
                    End If

                Case "fclientesprincipales"

                    If txtPassword.Text.ToString = "soarboledas" Or txtPassword.Text.ToString = "SOARBOLEDAS" Then
                        Me.Visible = False
                        Dim ClientesPrincipales As New ReporteClientesPrincipales
                        ReporteClientesPrincipales.ShowDialog()
                        Me.Close()
                    Else
                        Me.Close()
                    End If

                Case "fpagosContabilidad"
                    If txtPassword.Text.ToString = "pagos" Or txtPassword.Text.ToString = "PAGOS" Then
                        Me.Visible = False
                        Dim pagos As New pagos
                        pagos.ShowDialog()
                        Me.Close()
                    Else
                        Me.Close()
                    End If

                Case "InformeCuotas"
                    'If txtPassword.Text.ToString = "ventas" Or txtPassword.Text.ToString = "VENTAS" Then
                    If txtPassword.Text.ToString = "soarboledas" Or txtPassword.Text.ToString = "SOARBOLEDAS" Then
                        Me.Visible = False
                        Dim InfomeCuotas As New InformeCuotas
                        InformeCuotas.ShowDialog()
                        Me.Close()
                    End If


                Case "Informe de cuotas Mty"

                    If txtPassword.Text.ToString = "soarboledas" Or txtPassword.Text.ToString = "SOARBOLEDAS" Then
                        Me.Visible = False
                        Dim Informe_de_Cuotas_Mty As New Informe_de_Cuotas_Mty
                        Informe_de_Cuotas_Mty.Show()

                        Me.Close()

                    End If

                Case "InformeLineas"
                    'If txtPassword.Text.ToString = "ventas" Or txtPassword.Text.ToString = "VENTAS" Then
                    If txtPassword.Text.ToString = "soarboledas" Or txtPassword.Text.ToString = "SOARBOLEDAS" Then
                        Me.Visible = False
                        Dim InfomeLineas As New ReporteLineasGeneral
                        ReporteLineasGeneral.ShowDialog()
                        Me.Close()
                    Else
                        Me.Close()
                    End If


                Case "InformeVentasMes"
                    'If txtPassword.Text.ToString = "ventas" Or txtPassword.Text.ToString = "VENTAS" Then
                    If txtPassword.Text.ToString = "soarboledas" Or txtPassword.Text.ToString = "SOARBOLEDAS" Then
                        Me.Visible = False
                        Dim VentasMes As New DetalleArticulosXmes
                        DetalleArticulosXmes.ShowDialog()
                        Me.Close()
                    Else
                        Me.Close()
                    End If

                Case "CuadroEstrategico"
                    'If txtPassword.Text.ToString = "ventas" Or txtPassword.Text.ToString = "VENTAS" Then
                    If txtPassword.Text.ToString = "soarboledas" Or txtPassword.Text.ToString = "SOARBOLEDAS" Then
                        Me.Visible = False
                        Dim Cuadroestrategico As New CuadroEstrategico
                        Cuadroestrategico.ShowDialog()
                        Me.Close()
                    Else
                        Me.Close()
                    End If

            End Select
        End Sub

        Private Sub cerrar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cerrar.Click
            Me.Close()
        End Sub

        Private Sub frm_security_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        End Sub

    la segunda forma  es para generar un informe de  coutas

    Imports System.Data.SqlClient

    Public Class Informe_de_Cuotas_Mty


        Public NAgente As String = ""
        Public NombreAgente As String = ""
        Public Zona As String = ""
        Public Email As String = ""
        Public Cuota As String = ""
        'Public Cod As String = ""
        Friend Captura As Captura_Cuotas_2012





        Private Sub actualizar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles actualizar.Click
            Try

                DataGridView1.DataSource = Nothing
                Dim mes As String = ""
                Dim dia As String = ""

                If Mes1.Text = "Enero" Then
                    mes = "01"
                    dia = "31"
                ElseIf Mes1.Text = "Febrero" Then
                    mes = "02"
                    dia = "28"
                ElseIf Mes1.Text = "Marzo" Then
                    mes = "03"
                    dia = "31"
                ElseIf Mes1.Text = "Abril" Then
                    mes = "04"
                    dia = "30"
                ElseIf Mes1.Text = "Mayo" Then
                    mes = "05"
                    dia = "31"
                ElseIf Mes1.Text = "Junio" Then
                    mes = "06"
                    dia = "30"
                ElseIf Mes1.Text = "Julio" Then
                    mes = "07"
                    dia = "31"
                ElseIf Mes1.Text = "Agosto" Then
                    mes = "08"
                    dia = "31"
                ElseIf Mes1.Text = "Septiembre" Then
                    mes = "09"
                    dia = "30"
                ElseIf Mes1.Text = "Octubre" Then
                    mes = "10"
                    dia = "31"
                ElseIf Mes1.Text = "Noviembre" Then
                    mes = "11"
                    dia = "30"
                ElseIf Mes1.Text = "Diciembre" Then
                    mes = "12"
                    dia = "31"
                End If
                Dim mes_año_ini As String
                Dim mes_año_fin As String
                Dim mes_ini As DateTime = "01" & "/" & mes & "/" & Año1.Value
                mes_año_ini = Format(CDate(mes_ini), "dd/MM/yyyy")

                Dim mes_fin As DateTime = dia & "/" & mes & "/" & Año1.Value
                mes_año_fin = Format(CDate(mes_fin), "dd/MM/yyyy")

                Dim adapt_reporteCuotas As New SqlDataAdapter("SELECT * FROM [SBOArboledasMty].[dbo].[@CUOTAS] where U_FECHA >= '" & mes_año_ini & "' AND U_FECHA <= '" & mes_año_fin & "' order by cast(Code as int)", Cad_Conexion)
                Dim dtset_reporteCuotas As New DataSet
                ' Dim BS_Reporte1 As New DataSourceUpdateMode


                dtset_reporteCuotas.Clear()
                adapt_reporteCuotas.Fill(dtset_reporteCuotas, "Reporte de Cuotas mty")

                If dtset_reporteCuotas.Tables(0).Rows.Count > 0 Then
                    Bs_ReporteCuotas.DataSource = dtset_reporteCuotas
                    Bs_ReporteCuotas.DataMember = "Reporte de Cuotas"
                    Bn_ReporteCuotas.BindingSource = Bs_ReporteCuotas


                    DataGridView1.DataSource = Bs_ReporteCuotas



                    DataGridView1.Columns("Code").Width = 50
                    DataGridView1.Columns("Code").HeaderText = "Id"
                    DataGridView1.Columns("Name").Width = 80
                    DataGridView1.Columns("Name").HeaderText = "Zona"
                    DataGridView1.Columns("U_Agente").Width = 50
                    DataGridView1.Columns("U_Agente").HeaderText = "Agente"
                    DataGridView1.Columns("U_Nombre").Width = 120
                    DataGridView1.Columns("U_Nombre").HeaderText = "Nombre"
                    DataGridView1.Columns("U_Email").Width = 120
                    DataGridView1.Columns("U_Email").HeaderText = "E-mail"
                    DataGridView1.Columns("U_Cuota").Width = 90
                    DataGridView1.Columns("U_Cuota").HeaderText = "Cuota"
                    DataGridView1.Columns("U_FECHA").Width = 90
                    DataGridView1.Columns("U_FECHA").HeaderText = "Fecha"
                    ''DataGridView1.Columns("").HeaderText = "City"
                    ''DataGridView1.Columns("")..DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter
                    ''DataGridView1.Columns("").HeaderText = "Estado"
                    ''DataGridView1.Columns("").Width = 100








                End If

            Catch ex As Exception

                End

            End Try
        End Sub

        Private Sub cerrar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cerrar.Click

            Me.Close()
        End Sub
    End Class

    MI ERROR  ESTA EN ESTAS LINEAS

        Public NAgente As String = ""
        Public NombreAgente As String = ""
        Public Zona As String = ""
        Public Email As String = ""
        Public Cuota As String = ""
        'Public Cod As String = ""
        Friend Captura As Captura_Cuotas_2012

    ME MARCA  EL  SIGUIETE  ERROR

    null reference execption was unabled   {"Referencia a objeto no establecida como instancia de un objeto."}

    gracias  ojala me puedan oreintar  , yo entiendo que   estoy pasando  valores nullos pero no se como  coregirlo 


    ixtry

    viernes, 31 de agosto de 2012 18:14

Todas las respuestas

  • en todas esas linea es imposible que marque el error, solo tiene que ser en una sola

    quzias en

    Friend Captura As Captura_Cuotas_2012

    que es la unica que se tratad e un objeto, pero Captura_Cuotas_2012 que seria ?

    el mensaje se genera porque hay una variable que no se crea con el New para crear la instancia y a la cual quieres acceder

    saludos


    Leandro Tuttini

    Blog
    Buenos Aires
    Argentina

    viernes, 31 de agosto de 2012 19:05
  • mucas gracias ..  por contestarme  pero como te habras dado cuenta  estoy en pañales  y  en verdad quiero aprender

    captura_cuotas2012  seria 

    una forma 

    System.Data.SqlClient

    public  Class Captura_Cuotas_2012

       

    Public fecha As Date = Today

       

    Private Sub Captura_Cuotas_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

           

    If Utilerias_Arboledas2012.Mod_Arboledas.pNewSO = True Then



                Txt_Fecha.Text = fecha

                TxtCode.Text = Utilerias_Arboledas2012.Mod_Arboledas.pPedido

           

    End If


       

    End Sub



       

    Private Sub Txt_NumAgente_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles Txt_NumAgente.LostFocus

           

    If Utilerias_Arboledas2012.Mod_Arboledas.pNewSO = True Then


                Txt_Nombre.Text =

    ""


                Txt_Zona.Text =

    ""


                Txt_Email.Text =

    ""


                Label1.Text =

    ""


               

    'Dim adapt_config As New SqlDataAdapter("select top 1 * from [SBOArboledas2012A].[dbo].[@CUOTAS] ORDER BY CAST(Code AS Integer) DESC", Cad_Conexion)


               

    'Dim dtset_config As New DataSet


               

    'adapt_config.Fill(dtset_config, "config")



               

               

    Dim tabla As New DataTable

               

    ' pPedido = dtset_config.Tables(0).Rows(0).Item("Code").ToString() + 1


               

    Dim date_ini As String = ((fecha.Day - fecha.Day) + 1) & "/" & Month(fecha) & "/" & Year(fecha)

               

    Dim date_fin As String = fecha.Day & "/" & Month(fecha) & "/" & Year(fecha)

               

    Dim k As Integer


               

    Dim adapt_info_agente As New SqlDataAdapter("SELECT code,Name, U_Agente, U_Nombre, U_Email, U_FECHA, u_ciudad FROM [SBOArboledas2012A].[dbo].[@CUOTAS] where U_Agente ='" & Txt_NumAgente.Text & "'", Cad_Conexion)

               

    Dim dtset_info_agente As New DataSet

                adapt_info_agente.Fill(dtset_info_agente,

    "info_agente")

               

    If dtset_info_agente.Tables(0).Rows.Count > 0 Then


                   

    Try


                       

    For k = 0 To dtset_info_agente.Tables(0).Rows.Count - 1

                           

    If dtset_info_agente.Tables(0).Rows(k).Item("U_FECHA").ToString <> Nothing Then


                               

    If dtset_info_agente.Tables(0).Rows(k).Item("U_FECHA") >= date_ini And dtset_info_agente.Tables(0).Rows(k).Item("U_FECHA") <= date_fin Then


                                    MsgBox(

    "La informacion de este agente ya ha sido capturada en este mes")

                                    Txt_NumAgente.Text =

    ""


                                    Txt_NumAgente.Select()

                                   

    'Label1.Text = dtset_info_agente.Tables(0).Rows(dtset_info_agente.Tables(0).Rows.Count - 1).Item("code").ToString


                                   

    Exit Sub


                               

    End If


                           

    End If



                       

    Next


                       

    If dtset_info_agente.Tables(0).Rows.Count > 0 Then


                           

    '= dtset_ActualizaCuotas.Tables(0).Rows(0).Item("Code").ToString


                            Txt_Nombre.Text = dtset_info_agente.Tables(0).Rows(dtset_info_agente.Tables(0).Rows.Count - 1).Item(

    "U_Nombre").ToString

                            Txt_Zona.Text = dtset_info_agente.Tables(0).Rows(dtset_info_agente.Tables(0).Rows.Count - 1).Item(

    "U_ciudad").ToString

                            Txt_Email.Text = dtset_info_agente.Tables(0).Rows(dtset_info_agente.Tables(0).Rows.Count - 1).Item(

    "U_Email").ToString

                       

    End If


                   

    Catch ex As Exception

                   

    End Try



               

    End If


           

    End If


       

    End Sub



       

    Private Sub actualizar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles actualizar.Click

           

    If Txt_NumAgente.Text <> Nothing And Txt_Nombre.Text <> Nothing And Txt_Zona.Text <> Nothing And Txt_Email.Text <> Nothing And Txt_Cuota.Text <> Nothing Then



               

    Dim lCode, lU_Agente, lU_Nombre, lU_Email, lU_Cuota, lU_FECHA, lu_ciudad, lname As SqlParameter

               

    Dim cmdsql As SqlCommand

                conectar()

               

    If Utilerias_Arboledas2012.Mod_Arboledas.pNewSO = True Then ' And Label1.Text = " " Then


                    cmdsql =

    New SqlCommand("Insert Into [SBOArboledas2012a].[dbo].[@CUOTAS] values (@lCode, @lName, @lU_Agente, @lU_Nombre, @lU_Email, @lU_Cuota, @lU_FECHA,@lu_ciudad)", dbconexion)

                   

    '  cmdsql = New SqlCommand("Insert Into [PruebasGdl].[dbo].[@CUOTAS] values (@lCode, @lName, @lU_Agente, @lU_Nombre, @lU_Email, @lU_Cuota)", dbconexion)


               

    Else


                   

    ' cmdsql = New SqlCommand("Update [PruebasGdl].[dbo].[@CUOTAS]  set Name=@lName, U_Agente=@lU_Agente, U_Nombre=@lU_Nombre, U_Email=@lU_Email, U_Cuota=@lU_Cuota, U_FECHA=@lU_FECHA where Code='" & TxtCode.Text & "'", dbconexion)


                    cmdsql =

    New SqlCommand("Update [SBOArboledas2012a].[dbo].[@CUOTAS] set U_ciudad=@lu_ciudad, U_Agente=@lU_Agente, U_Nombre=@lU_Nombre, U_Email=@lU_Email, U_Cuota=@lU_Cuota  where Code='" & TxtCode.Text & "'", dbconexion)

               

    End If


                lCode = cmdsql.Parameters.Add(

    "@lCode", SqlDbType.Int) : lCode.Value = TxtCode.Text

                lName = cmdsql.Parameters.Add(

    "@lname", SqlDbType.Int) : lName.Value = TxtCode.Text

                lu_ciudad = cmdsql.Parameters.Add(

    "@lu_ciudad", SqlDbType.NVarChar) : lu_ciudad.Value = Txt_Zona.Text

                lU_Agente = cmdsql.Parameters.Add(

    "@lU_Agente", SqlDbType.NVarChar) : lU_Agente.Value = Txt_NumAgente.Text

                lU_Nombre = cmdsql.Parameters.Add(

    "@lU_Nombre", SqlDbType.VarChar) : lU_Nombre.Value = Txt_Nombre.Text

                lU_Email = cmdsql.Parameters.Add(

    "@lU_Email", SqlDbType.VarChar) : lU_Email.Value = Txt_Email.Text

                lU_Cuota = cmdsql.Parameters.Add(

    "@lU_Cuota", SqlDbType.Money) : lU_Cuota.Value = CDbl(Txt_Cuota.Text)

                lU_FECHA = cmdsql.Parameters.Add(

    "@lU_FECHA", SqlDbType.DateTime) : lU_FECHA.Value = Txt_Fecha.Text

               

    Try


                    cmdsql.ExecuteNonQuery()

                    MsgBox(

    "Tu informacion ha sido grabada")

               

    Catch ex As Exception

                    MsgBox(ex.ToString, MsgBoxStyle.Critical,

    Me.Text)

               

    End Try


                desconectar()

               

    Me.Close()

           

    Else


                MsgBox(

    "Verifica que ningun campo este vacio")

           

    End If


       

    End Sub


       

    Private Sub cerrar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cerrar.Click

           

    Me.Close()

       

    End Sub



       

    Private Sub Txt_NumAgente_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Txt_NumAgente.TextChanged

       

    End Sub

    End  class       esta seria la  parete  donde creo que se crea la variable         

    Case "InformeCuotas"


    'If txtPassword.Text.ToString = "ventas" Or txtPassword.Text.ToString = "VENTAS" Then


                   

    If txtPassword.Text.ToString = "soarboledas" Or txtPassword.Text.ToString = "SOARBOLEDAS" Then


                       

    Me.Visible = False


                       

    Dim InfomeCuotas As New InformeCuotas

                        InformeCuotas.ShowDialog()

                       

    Me.Close()

                   

    End If

    gracias


    ixtry

    martes, 4 de septiembre de 2012 13:58