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