By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,034 Members | 1,714 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,034 IT Pros & Developers. It's quick & easy.

MySQL & ByteFX (Invalid PInvoke metadata format)

P: n/a
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(MySqlConnectio nString 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
Friend WithEvents ppOrderAdapter As

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;" & _

ppConnection = New
ByteFX.Data.MySqlClient.MySqlConnection(ppConnectS tr)
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
Catch ex As Exception
End Try

End Sub
End Class

Nov 20 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.