unable to retrive UniException.InnerException.Code from Mysql provider
Posted: Mon 29 Aug 2016 21:31
Hi,
On debugging i'm able to see the code "203" (Can't connect to MySql server...) on "UniException.InnerException.Code" on debug, but im not able to retrive this value.
here is my code:
I get the following error (translated from italian operating system):
"Unable to cast [A] Devart.Data.MySql.MySqlException to Devart.Data.MySql.MySqlException. The type A has originated from 'Devart.Data.Universal.MySql, Version = 3.60.1211.0, Cultures = neutral, PublicKeyToken = 09af7300eec23701 'in the' Default 'setting in the' C: \ WINDOWS \ assembly \ GAC_MSIL \ Devart.Data.Universal.MySql \ 3.60.1211.0__09af7300eec23701 \ Devart.Data.Universal.MySql.dll '. The type B originates from 'Devart.Data.MySql, Version = 8.6.714.0, Culture = neutral, PublicKeyToken = 09af7300eec23701' in the 'Default' setting in the 'C: \ WINDOWS \ assembly \ GAC_MSIL \ Devart.Data.MySql \ 8.6. 714.0__09af7300eec23701 \ Devart.Data.MySql.dll '. "
I'm using vb.net on .net 4.5 with the latest dcuniversal 3.60.1211 and dc mysql 8.6.714
On debugging i'm able to see the code "203" (Can't connect to MySql server...) on "UniException.InnerException.Code" on debug, but im not able to retrive this value.
here is my code:
Code: Select all
Try
Dim con As UniConnection = New .UniConnection("provider=MySQL;Server=fake ip;Database="abcd";Uid=root;Pwd=root;Connection Timeout=1")
con.Open()
Catch ex As UniException
Dim exType As Type = ex.InnerException.GetType()
Select Case exType.FullName
Case "Devart.Data.MySql.MySqlException"
Dim code As Integer = DirectCast(ex.InnerException, Devart.Data.MySql.MySqlException).Code
End Select
End Try
"Unable to cast [A] Devart.Data.MySql.MySqlException to Devart.Data.MySql.MySqlException. The type A has originated from 'Devart.Data.Universal.MySql, Version = 3.60.1211.0, Cultures = neutral, PublicKeyToken = 09af7300eec23701 'in the' Default 'setting in the' C: \ WINDOWS \ assembly \ GAC_MSIL \ Devart.Data.Universal.MySql \ 3.60.1211.0__09af7300eec23701 \ Devart.Data.Universal.MySql.dll '. The type B originates from 'Devart.Data.MySql, Version = 8.6.714.0, Culture = neutral, PublicKeyToken = 09af7300eec23701' in the 'Default' setting in the 'C: \ WINDOWS \ assembly \ GAC_MSIL \ Devart.Data.MySql \ 8.6. 714.0__09af7300eec23701 \ Devart.Data.MySql.dll '. "
I'm using vb.net on .net 4.5 with the latest dcuniversal 3.60.1211 and dc mysql 8.6.714