Search found 3 matches

by novice
Wed 31 Aug 2016 22:18
Forum: dotConnect Universal
Topic: unable to retrive UniException.InnerException.Code from Mysql provider
Replies: 4
Views: 6185

Re: unable to retrive UniException.InnerException.Code from Mysql provider

Pinturiccio wrote:This is a designed behavior. The reason is that the inner exception of UniException has the MySqlException type. But this type is located in Devart.Data.Universal.MySql.dll and thus, the inner exception cannot be cast to the MySqlException type from the Devart.Data.MySql.dll assembly.

You can see that your inner exception is a type of Devart.Data.Universal.MySql assembly in the AssemblyQualifiedName property of your exType variable. For more information, please refer to https://msdn.microsoft.com/en-us/librar ... .110).aspx
Hello again,
how can I take this value (UniException.InnerException.Code)?
by novice
Tue 30 Aug 2016 08:21
Forum: dotConnect Universal
Topic: Welcome to dotConnect Team's Blog!
Replies: 2
Views: 37927

Re: Welcome to dotConnect Team's Blog!

Error
The requested page was not found
Requested Url: http://www.devart.com/blogs/dotconnect/
Try another way:

Go back and try again
If you entered the address manually, please check the spelling and try again
If there is a dead link in our site, please inform us about it
Return to main page
by novice
Mon 29 Aug 2016 21:31
Forum: dotConnect Universal
Topic: unable to retrive UniException.InnerException.Code from Mysql provider
Replies: 4
Views: 6185

unable to retrive UniException.InnerException.Code from Mysql provider

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:

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
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