IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

VB.NET Discussion :

Bug au lancement du Programme


Sujet :

VB.NET

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2011
    Messages
    193
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Bénin

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2011
    Messages : 193
    Par défaut Bug au lancement du Programme
    Avant tout, je voudrais souhaiter une bonne & Heureuse Année à toute la communauté.

    J'ai un gros soucis et je voudrais que vous m'aidiez à solutionner ça.

    J'ai écris un programme en Vb 2010 sous win 7
    Lorsque je l'exécute dans mon IDE ou install le setup sur mon pc de développement, ça s'exécute sans problème mais lorsque je l'installe ailleurs, j'ai des bug. Dans mes recherches on m'a dit de mettre le démarrage sur formulaire au lieu de sub Main.
    Mais quand je met le démarrage sur formulaire, j'ai ce bug :
    The type initializer for 'SCREANCE2011.EDDYPHAN' threw an exception
    Mais lorsque je reviens dans mon sub main comme démarrage, j'ai toujours un bug :
    Problème : APPCRASH
    Nom du module par défaut : KERNELBASE.dll

    voici mon module de démarrage :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
     
     
    Imports System
    Imports System.Data
    Imports System.Data.SqlClient
    Imports System.IO
     
    Module EDDYPHAN
     
        Public BD As New SqlConnection
        Public stcon, dada, list As String
        Public Ji, Mi, Ai As String
        'Public Mi As Date
        Public NATPATH As String
        Public loginpastor As String
     
        Public nb As Integer
     
        Public avi As String
        Public An, Mo, Jo As Date
        Public n, pt As Integer
        Public datfin, datvali, eche As Date
        Public vdate1, vdate2, vdate3 As Date
        Public Kar, Del As String
        Public SMenu, ty As String
        Public formName As Object
        Public z As Integer = 0
        Public frmSit As New RptSit
        Public etsit As New etcli
        Public DARE, daPepe, dacbo, daco, dato, daeche, dafac As SqlDataAdapter
        Public DSRE, dspepe, dscbo, dsco, dsto, dseche, dsfac As New DataSet
     
     
        Public fin, fin1 As Integer
        Public modi As Boolean
        Public T1, T2, T3, TD, TCR, TCT, TK, LV, LC, LR, Aho As Decimal
     
        Public etatcli As New FichCli
        Public cac As New RPTFvb
        Public etatc As New ActCredit
        Public i As Integer
        Public eddy As SqlCommand
        Public CMUP As SqlCommandBuilder
        Public daro As DataRow
        Public dela As Integer = 10
        Public listc As String
     
     
        Public Sub CONNEXION()
            MsgBox("A")
            Dim sw As New StreamReader(Application.StartupPath + "\connexe.txt")
            If File.Exists(Application.StartupPath + "\connexe.txt") = False Then
     
                NATPATH = ""
     
            Else
     
                NATPATH = sw.ReadLine
                NATPATH = UCase(NATPATH)
     
            End If
     
     
            MsgBox(NATPATH)
            BD = New SqlConnection("Data Source= " & NATPATH & ";PASSWORD = secundia84;Integrated Security =SSPI; Persist Security Info =True;user ID =sa;initial Catalog = SCREANCE; ")
     
     
            With BD
     
                Try
     
                    BD.Open()
                    MsgBox(BD.State)
                    'frconnexio.ShowDialog()
                Catch ex As Exception
                    MsgBox("Serveur de Données mal configuré...")
                    MsgBox(Err.Description)
                End Try
     
            End With
     
     
        End Sub
        Sub Main()
     
            'MsgBox("Sub")
            'CONNEXION()
            frconnexio.ShowDialog()
     
            'daeche = New SqlDataAdapter("select * from ListEChe where DateEche < '" & Now.ToShortDateString & "' and optgere = 'False' and optaverti = 'False'", BD)
            'daeche.Fill(dseche, "ListEChe")
            'MsgBox(dseche.Tables("ListEChe").Rows.Count)
     
            'If dseche.Tables("ListEChe").Rows.Count <> 0 Then
            '    If MsgBox("Il y a '" & dseche.Tables("ListEChe").Rows.Count & "' échéances à recouvrir ce jour. Voulez-vous les visualiser", MsgBoxStyle.YesNo) = vbYes Then
            '        'MsgBox("Bravo")
            '    End If
            'End If
     
            'frconnexio.ShowDialog()
     
     
        End Sub
        Public Sub executerrequet(ByVal sql As String)
            Dim myconnection As SqlConnection = BD
            Dim Mycommand As SqlCommand = myconnection.CreateCommand()
            Mycommand.CommandText = sql
            Mycommand.ExecuteNonQuery()
            myconnection.Close()
        End Sub
        Public Function resultatrequet(ByVal sql As String) As SqlDataReader
            Dim myconnection As SqlConnection = BD
            ' myconnection.Open()
            Dim myreader As SqlDataReader
            Using Command As New SqlCommand(sql, myconnection)
                Command.CommandType = CommandType.Text
                myreader = Command.ExecuteReader(CommandBehavior.CloseConnection)
            End Using
            Return myreader
        End Function
        Public Function verifiedoublon(ByVal sql As String, ByVal numcol As Integer, ByVal champ As String) As Integer
            Dim resultat As SqlDataReader
            resultat = resultatrequet(sql)
            Dim touve As Boolean = 0
            Do While resultat.Read
                If champ = resultat(numcol) Then
                    touve = -1
                    Exit Do
                End If
            Loop
            Return touve
        End Function
        Public Sub remplircombo(ByVal rqt As String, ByVal cbo As ComboBox)
            Dim reader As SqlDataReader = resultatrequet(rqt)
            Do While reader.Read
                cbo.Items.Add(reader(0))
            Loop
        End Sub
     
    End Module

  2. #2
    Membre Expert
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Novembre 2010
    Messages
    793
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : France, Mayenne (Pays de la Loire)

    Informations professionnelles :
    Activité : Développeur .NET

    Informations forums :
    Inscription : Novembre 2010
    Messages : 793
    Par défaut
    Bonjour,

    utilises-tu des DLL externes ?
    Si oui sont elle incluses à la solution (Clic droit sur le projet, Publier, Chemins, Fichiers d'application) ?

  3. #3
    Membre confirmé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2011
    Messages
    193
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Bénin

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2011
    Messages : 193
    Par défaut
    Merci beaucoup pour ta solution
    Je n'ai aucun dll à l'extérieur. Quand j'ai utiliser la méthode publié, ça a repris la même.
    J'ai du changer méthode connectionstring
    j'avais fait ceci dans mon code :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
     
      Dim sw As New StreamReader(Application.StartupPath + "\connexe.txt")
     
            If File.Exists(Application.StartupPath + "\connexe.txt") = False Then
     
                NATPATH = ""
                MsgBox("vide")
            Else
     
                NATPATH = sw.ReadLine
                NATPATH = UCase(NATPATH)
                MsgBox(NATPATH)
            End If
     
                BD = New SqlConnection("Data Source= " & NATPATH & ";PASSWORD = secundia84;Integrated Security =SSPI; Persist Security Info =True;user ID =sa;initial Catalog = SCREANCE; ")
     
     
     
                With BD
     
                    Try
     
                        BD.Open()
     
                        frconnexio.ShowDialog()
                    Catch ex As Exception
                        MsgBox("Serveur de Données mal configuré...")
                        MsgBox(Err.Description)
                    End Try
     
                End With

    A présent, je mets la chaine de connexion dans un formulaire et la récupère dans une variable gblobal "con" et ça marche. Je n'ai pas compris mais ça marche.

  4. #4
    Membre chevronné
    Homme Profil pro
    Développeur Web
    Inscrit en
    Juin 2003
    Messages
    353
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : France, Hérault (Languedoc Roussillon)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Juin 2003
    Messages : 353
    Par défaut
    Citation Envoyé par asmduty Voir le message
    Bonjour,

    utilises-tu des DLL externes ?
    Si oui sont elle incluses à la solution (Clic droit sur le projet, Publier, Chemins, Fichiers d'application) ?
    Bonjour,
    avec mon application, j'obtiens ce message.

    Est ce que le fait d'avoir des DLL à l'extérieur change quelque chose ?

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. pile corrompue dès le lancement du programme
    Par YéTeeh dans le forum C++
    Réponses: 4
    Dernier message: 24/04/2006, 14h10
  2. Créer un object au premier lancement du programme ?
    Par david06600 dans le forum Langage
    Réponses: 1
    Dernier message: 01/03/2006, 12h04
  3. Réponses: 1
    Dernier message: 30/11/2005, 23h14
  4. Delphi 2005 Indy 9 Erreur au lancement du programme
    Par Houben Jacques dans le forum Web & réseau
    Réponses: 4
    Dernier message: 08/11/2005, 12h05
  5. [DCOM] Accès refusé au lancement du programme à distance
    Par raoulmania dans le forum Web & réseau
    Réponses: 7
    Dernier message: 22/06/2005, 13h01

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo