Bjr a tous,
j'ai un soucis qui me parrait pas annodin.
dans mon code j'apel une fonction que j'ai écris. Mon probléme c'est que lors de l'éxecution, il passe pas dans la fonction. Je dois mettre un point d'arret sur l'appel de la fonction pour le forcer à y entrer sinon il la saute. Et comme j'ai fais 2 fonction quasi similaire, bah il me pose se pb sur les 2 appels aux fonctions, donc je dois mettre 2 point d'arret et sa me soule

voici mon code :
fonction appelante :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
Public Sub NewRCs_enreg(ByVal int_strat_id As Integer)
...
Dim sql_rcname As String
            Dim sql_LastRC_id As Integer
            Dim recup_LastRc_id As Integer
(point d'arret!)   recup_LastRc_id = Recupere_Last_RC_id(sql_LastRC_id)
            sql_rcname = "RC_" + recup_LastRc_id.ToString()

....
 End Sub
fonction appeler :
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
Public Function Recupere_Last_RC_id(ByVal Last_RC_id As Integer) As Integer
        'creer un objet connexion ainsi qu'un objet command
        Dim myConnexion As OleDbConnection = New System.Data.OleDb.OleDbConnection(My.Settings.Map_ConnectionString())
        Dim myCommand As OleDbCommand = New System.Data.OleDb.OleDbCommand()
 
        'on creer une variable pour recuperer la donnée rechercher
        ' Dim sql_RC_id_last As Integer
        myCommand.CommandText = "select max(RC_id) from RCs;"
        myCommand.Connection = myConnexion
 
        Try
            'ouvre la connexion a la bdd
            myConnexion.Open()
            'execute notre commande
            ' sql_RC_id_last = myCommand.ExecuteNonQuery()
            Last_RC_id = myCommand.ExecuteScalar()
 
 
        Catch ex As OleDb.OleDbException
            MessageBox.Show(ex.ToString)
        End Try
        'fermeture de la connexion
        myConnexion.Close()
 
        Return Last_RC_id
    End Function