Bonjour à tous,
J'ai un problème de connexion avec mon service.
J'ai une méthode qui retourne un boolean. Tout marchait correctement quand je l'appelle.
Cependant je l'ai redéfini pour renvoyer un "converter" et là, j'ai cette erreur que je ne comprends pas:
Voici le code d'origine:
Et le code modifié:
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 Public Function Read() As Boolean Implements IService1.Read Try Dim dtmCurrentDate As DateTime = DateTime.Now Dim connection As New clsConnectionBD() connection.ConnectionString = "Data Source=NICOLEDE;Persist Security Info=True;User ID=metaV5;Password=metaV5;" connection.Type = clsConnectionBD.BDDType.Oracle _configMA.PathMeta = "C:\DEV_5\Meta Analysis Dev\" _configMA.TypeAppli = clsAppli.Type.MetaService '_configMA.PathMeta = "C:\DEV_5\Meta Analysis Dev\" connection.Open() If connection.IsConnected = False Then _elgEvent.WriteEntry("Connexion à la base impossible : " + connection.ConnectionString, EventLogEntryType.Error) Return False End If Dim reader As DbDataReader reader = connection.ExecSelectToDR("SELECT IDE_PLN, ALIAS, DAYS, HOURS, IDE_PRJ,APPLICATION, ARGS, IDE_LANG, USR_LOG_PLN, USR_LOG_EXE FROM T_PLN") Dim noAppli As Boolean = False If reader.HasRows = True Then Do While reader.Read() Dim converter As clsConverterRunner = Nothing noAppli = False Select Case reader("APPLICATION").ToString() 'Ajouter les connectivités ici. Case BOXIUNV_APPLICATION converter = New clsBOXIUnvConverterRunner(_elgEvent) Case BOXIDOC_APPLICATION converter = New clsBOXIDocConverterRunner(_elgEvent) Case ORACLE_APPLICATION converter = New clsOracleConverterRunner(_elgEvent) Case SQLSERVER_APPLICATION converter = New clsSQLServerConverterRunner(_elgEvent) Case SYBASEIQ_APPLICATION converter = New clsSyBaseIQConverterRunner(_elgEvent) Case DELETE_APPLICATION converter = New clsPlanifDeleteLogRunner(_elgEvent) Case GENIO_APPLICATION converter = New clsGenioConverterRunner(_elgEvent) Case POWER_AMC_APPLICATION converter = New clsPowerAmcConverterRunner(_elgEvent) Case COGNOS_APPLICATION converter = New clsCognosConverterRunner(_elgEvent) Case TALEND_APPLICATION converter = New clsTalendConverterRunner(_elgEvent) Case Else noAppli = True End Select If noAppli = False Then converter.ConfigMA = _configMA converter.IdePln = reader("IDE_PLN").ToString() converter.AliasName = reader("ALIAS").ToString() converter.IdePrj = reader("IDE_PRJ").ToString() converter.Days = reader("DAYS").ToString() If converter.IsStartNow Then converter.UserLoginExe = reader("USR_LOG_EXE").ToString() End If converter.Hours = reader("HOURS").ToString() converter.IdeLangue = reader("IDE_LANG").ToString() converter.UserLoginPln = reader("USR_LOG_PLN").ToString() If converter.InitWith(reader("ARGS").ToString()) Then If converter.IsOkToConvert(dtmCurrentDate) Then updateDaysStatus(converter) If Not FifoContains(converter) Then _fifoConverterRunners.Enqueue(converter) End If End If End If End If Loop End If connection.Close() Return True Catch ex As Exception _elgEvent.WriteEntry(ex.Message + " " + ex.StackTrace, EventLogEntryType.Error) End Try End Function
J'ai cherché partout sur le net, impossible de corriger mon erreur.
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 Public Function Read() As clsConverterRunner Implements IService1.Read Try Dim dtmCurrentDate As DateTime = DateTime.Now Dim connection As New clsConnectionBD() connection.ConnectionString = "Data Source=NICOLEDE;Persist Security Info=True;User ID=metaV5;Password=metaV5;" connection.Type = clsConnectionBD.BDDType.Oracle _configMA.PathMeta = "C:\DEV_5\Meta Analysis Dev\" _configMA.TypeAppli = clsAppli.Type.MetaService '_configMA.PathMeta = "C:\DEV_5\Meta Analysis Dev\" connection.Open() If connection.IsConnected = False Then _elgEvent.WriteEntry("Connexion à la base impossible : " + connection.ConnectionString, EventLogEntryType.Error) ' Return False End If Dim reader As DbDataReader reader = connection.ExecSelectToDR("SELECT IDE_PLN, ALIAS, DAYS, HOURS, IDE_PRJ,APPLICATION, ARGS, IDE_LANG, USR_LOG_PLN, USR_LOG_EXE FROM T_PLN") Dim noAppli As Boolean = False Dim converter As clsConverterRunner = Nothing 'visibilité du converter -> valeur de retour If reader.HasRows = True Then Do While reader.Read() ' Dim converter As clsConverterRunner = Nothing noAppli = False Select Case reader("APPLICATION").ToString() 'Ajouter les connectivités ici. Case BOXIUNV_APPLICATION converter = New clsBOXIUnvConverterRunner(_elgEvent) Case BOXIDOC_APPLICATION converter = New clsBOXIDocConverterRunner(_elgEvent) Case ORACLE_APPLICATION converter = New clsOracleConverterRunner(_elgEvent) Case SQLSERVER_APPLICATION converter = New clsSQLServerConverterRunner(_elgEvent) Case SYBASEIQ_APPLICATION converter = New clsSyBaseIQConverterRunner(_elgEvent) Case DELETE_APPLICATION converter = New clsPlanifDeleteLogRunner(_elgEvent) Case GENIO_APPLICATION converter = New clsGenioConverterRunner(_elgEvent) Case POWER_AMC_APPLICATION converter = New clsPowerAmcConverterRunner(_elgEvent) Case COGNOS_APPLICATION converter = New clsCognosConverterRunner(_elgEvent) Case TALEND_APPLICATION converter = New clsTalendConverterRunner(_elgEvent) Case Else noAppli = True End Select If noAppli = False Then converter.ConfigMA = _configMA converter.IdePln = reader("IDE_PLN").ToString() converter.AliasName = reader("ALIAS").ToString() converter.IdePrj = reader("IDE_PRJ").ToString() converter.Days = reader("DAYS").ToString() If converter.IsStartNow Then converter.UserLoginExe = reader("USR_LOG_EXE").ToString() End If converter.Hours = reader("HOURS").ToString() converter.IdeLangue = reader("IDE_LANG").ToString() converter.UserLoginPln = reader("USR_LOG_PLN").ToString() If converter.InitWith(reader("ARGS").ToString()) Then If converter.IsOkToConvert(dtmCurrentDate) Then updateDaysStatus(converter) If Not FifoContains(converter) Then _fifoConverterRunners.Enqueue(converter) End If End If End If End If connection.Close() reader.Close() Return converter Loop End If ' connection.Close() ' Return converter ' Return True Catch ex As Exception _elgEvent.WriteEntry(ex.Message + " " + ex.StackTrace, EventLogEntryType.Error) End Try End Function
Merci d'avance![]()
Partager