MySQL & ByteFX (Invalid PInvoke metadata format)

D

Don Lopez

I get this exception when I try to run open on the MySQLConnection
object. It goes like this:

System.TypeLoadException: Invalid PInvoke metadata format.
at System.Net.OSSOCK.gethostbyname(String host)
at System.Net.Dns.GetHostByName(String hostname)
at ByteFX.Data.Common.StreamCreator.GetStream(Int32 timeOut)
at ByteFX.Data.MySqlClient.Driver.Open(MySqlConnectionString settings)
--- End of inner exception stack trace ---
at ByteFX.Data.MySqlClient.Driver.Open()
[...]


Has anyone got ByteFX to open a connection successfully? Am I setting
something up wrong? Here's my code:


Public Class Form1
Inherits System.Windows.Forms.Form

Friend WithEvents ppConnection As
ByteFX.Data.MySqlClient.MySqlConnection
Friend WithEvents ppOrderAdapter As
ByteFX.Data.MySqlClient.MySqlDataAdapter

Private Sub InitDB() ' This gets called right after the
IDE-generated InitializeComponent()
Dim ppOrderSelect As String = _
"SELECT <field1>, <field2> " & _
"FROM Orders;"
Dim ppConnectStr As String = _
"SERVER=localhost;" & _
"DATABASE=ProdPlan;" & _
"UID=<uid>;PASSWORD=<pwd>;"

ppConnection = New
ByteFX.Data.MySqlClient.MySqlConnection(ppConnectStr)
ppOrderAdapter = New ByteFX.Data.MySqlClient.MySqlDataAdapter _
(ppOrderSelect, ppConnection)
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Try
ppConnection.Open()
Catch ex As Exception
MsgBox(ex.ToString)
End Try

End Sub
End Class
 
K

kuntals

I'm also getting the same problem. Tried lot of ways but with no success.

Let me know if any one has successfully used ByteFX to open connection with MySQL.

Thanks in Advance,
- K.K.

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top