Hello.
I have a problem that appears randomly before execute a query using a simple routine (MySQLConnection+MySQLCommand+MySQLReader). The exception that I can't control is:
System.Transactions Critical: 0 : http://msdn.microsoft.com/TraceCodes/Sy ... /Unhandled
Excepción no controlada(Unhandled exception)
WS2.vshost.exe
System.InvalidOperationException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
LinkedList is empty.
in System.Collections.Generic.LinkedList`1.RemoveFirst()
in Devart.Common.z.a()
in System.Threading.ThreadHelper.ThreadStart_Context(Object state)
in System.Threading.ExecutionContext.runTryCode(Object userData)
in System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
in System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
in System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
in System.Threading.ThreadHelper.ThreadStart()System.InvalidOperationException: LinkedList está vacía.(LinkedList is empty)
in System.Collections.Generic.LinkedList`1.RemoveFirst()
in Devart.Common.z.a()
in System.Threading.ThreadHelper.ThreadStart_Context(Object state)
in System.Threading.ExecutionContext.runTryCode(Object userData)
in System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
in System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
in System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
in System.Threading.ThreadHelper.ThreadStart()
Notes:
* Visual Studio 2008 version 9.0.30729.1 SP1
* .Net Framework 3.5 SP1
* Windows 7 Ultimate
I'll appreciate your help.
Best regards
Victor
System.InvalidOperationException: LinkedList is empty
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
Could you please describe the scenario you are trying to perform in more details? In particular, please specify (at least roughly) the SQL command you are executing and the way you are using the components mentioned. If possible, please send us a complete test project with which the problem can be reproduced; please include the scripts needed to create the database objects in this case. We couldn't reproduce the issue in our environment.
Does this exception have an inner one? If yes, could you please specify its message and stack trace?
Also, what exact versions of dotConnect for MySQL and MySQL server are you using?
Does this exception have an inner one? If yes, could you please specify its message and stack trace?
Also, what exact versions of dotConnect for MySQL and MySQL server are you using?
System.InvalidOperationException: LinkedList is empty
Thank you very much for your reply. I'm trying to isolate the code that is associated with the error to send to you. I think however, that the problem is "very" random, usually associated with the execution of code as follows:
Public Sub FillWithItemsCB( _
ByVal trgControl As System.Windows.Forms.ComboBox, _
ByVal pMySqlCommand As String, _
ByVal pHost As String, _
ByVal pUser As String, _
ByVal pPass As String, _
ByVal pPort As String)
Dim inDBCon As New MySqlConnection 'Conexión
Dim inCommand As New MySqlCommand 'Comando
Dim inReader As MySqlDataReader 'Lector
Dim inSuccess As Boolean = False 'Marcador de éxito
'Preparando la conexión
With inDBCon
.Host = pHost
.UserId = pUser
.Password = pPass
.Port = pPort
.Database = Const_DB
End With
'Preparando el comando
With inCommand
.CommandText = pMySqlCommand
End With
'Limpiando datos
With trgControl
.Items.Clear()
End With
Try 'Primer nivel de prueba
inDBCon.Open()
inSuccess = True
Catch ex As Exception
inSuccess = False
Finally
Try 'Segundo nivel de prueba
'Ejecuto el comando contra el reader
inCommand.Connection = inDBCon
inReader = inCommand.ExecuteReader
inSuccess = True
Try
Do While inReader.Read
trgControl.Items.Add(inReader.Item(0))
Loop
Catch ex As Exception
Finally
inReader.Dispose()
End Try
Catch ex As Exception
Debug.Print(ex.Message)
Exit Try
End Try
End Try
End Sub
Scenario:
* My project has conventional controls, except for a TreeView control and another called Ultragrid (from Infragistics).
* According to my log, the problem was present before use such controls.
* I'm use the latest version of Devart
* The MySQL version is 5.1
* I could not handle the error through Try-Catch-End Try or using ON ERROR GOTO, then end execution.
* When I restart the program and performed the same steps, the error can occur again or not. It usually happens that the program works normally.
* SQL queries I use are quite simple. The last one caused a problem was:
SELECT p.codigo, c.descripcio
FROM pac_convenios p, con_convenio c
WHERE
p.codigo = c.codigo AND
c.vigencia = 1 AND
p.pac_id = 2
Best regards
Victor
Public Sub FillWithItemsCB( _
ByVal trgControl As System.Windows.Forms.ComboBox, _
ByVal pMySqlCommand As String, _
ByVal pHost As String, _
ByVal pUser As String, _
ByVal pPass As String, _
ByVal pPort As String)
Dim inDBCon As New MySqlConnection 'Conexión
Dim inCommand As New MySqlCommand 'Comando
Dim inReader As MySqlDataReader 'Lector
Dim inSuccess As Boolean = False 'Marcador de éxito
'Preparando la conexión
With inDBCon
.Host = pHost
.UserId = pUser
.Password = pPass
.Port = pPort
.Database = Const_DB
End With
'Preparando el comando
With inCommand
.CommandText = pMySqlCommand
End With
'Limpiando datos
With trgControl
.Items.Clear()
End With
Try 'Primer nivel de prueba
inDBCon.Open()
inSuccess = True
Catch ex As Exception
inSuccess = False
Finally
Try 'Segundo nivel de prueba
'Ejecuto el comando contra el reader
inCommand.Connection = inDBCon
inReader = inCommand.ExecuteReader
inSuccess = True
Try
Do While inReader.Read
trgControl.Items.Add(inReader.Item(0))
Loop
Catch ex As Exception
Finally
inReader.Dispose()
End Try
Catch ex As Exception
Debug.Print(ex.Message)
Exit Try
End Try
End Try
End Sub
Scenario:
* My project has conventional controls, except for a TreeView control and another called Ultragrid (from Infragistics).
* According to my log, the problem was present before use such controls.
* I'm use the latest version of Devart
* The MySQL version is 5.1
* I could not handle the error through Try-Catch-End Try or using ON ERROR GOTO, then end execution.
* When I restart the program and performed the same steps, the error can occur again or not. It usually happens that the program works normally.
* SQL queries I use are quite simple. The last one caused a problem was:
SELECT p.codigo, c.descripcio
FROM pac_convenios p, con_convenio c
WHERE
p.codigo = c.codigo AND
c.vigencia = 1 AND
p.pac_id = 2
Best regards
Victor
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
Please specify at which point the error occurs (you can check this under debug). Also, please specify whether you are using the MySqlMonitor class in your application. If possible, please send us a test project with which the problem can be reproduced (at least sometimes).
We couldn't reproduce the problem in our environment.
We couldn't reproduce the problem in our environment.
-
- Posts: 1
- Joined: Thu 17 Feb 2011 15:58
Hi, anyone found a solution to this problem? I have the same throuble in my Silverlight aplication with almost the same StackTrace...
And like your application, not happens all the time... by this way is too dificult to find where the exception is throwing...
Here is my stack trace:
at System.Collections.Generic.LinkedList`1.RemoveFirst()
at Devart.Common.y.a()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
And like your application, not happens all the time... by this way is too dificult to find where the exception is throwing...
Here is my stack trace:
at System.Collections.Generic.LinkedList`1.RemoveFirst()
at Devart.Common.y.a()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
According to the stack trace, the problem may be related to the MySqlMonitor component. Please specify the way you are using (if you do) MySqlMonitor in your application or, if possible, send us a test project with which the issue can be reproduced.
Also, please try disabling MySqlMonitor to check whether the problem persists in this case.
Also, please try disabling MySqlMonitor to check whether the problem persists in this case.