473,385 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

MySQL & ByteFX (Invalid PInvoke metadata format)

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
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(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
Try
ppConnection.Open()
Catch ex As Exception
MsgBox(ex.ToString)
End Try

End Sub
End Class

Nov 20 '05 #1
0 982

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Gacu | last post by:
Hi, An unhandled exception of type 'System.TypeLoadException' occured in system.dll Additional information: Invalid PInvoke metadata format Im getting this error afrer calling...
5
by: Tim Bücker | last post by:
Hello. I am trying to get a connection to MySQL using OleDb but it seems that I am making something wrong. I´ve found this source in the net but it doesn´t work for me: ...
10
by: John Smith | last post by:
I know that uploading an image to a database has been covered, oh, about 3 trillion times. However, I haven't found anything covering uploading to a MySQL database with .net. Please don't...
7
by: Jim Lawton | last post by:
I'm not sure where my problem lies, but someone here might have a suggestion. I'm developing a .NET web application, (but I don't really) think that's relevant. I'm running MySQL 4.1.7-nt on...
4
by: Jassim Rahma | last post by:
Hi, How can I directlly connect to mySQL server from C# without an ODBC drive? connecting through ODBC means I have to include mySQL Connecter/ODBC in my distribution media.. I want to only...
0
by: covadnews | last post by:
Hi, I upgraded from .NET to .NET 2003 (w/ Framework 1.1.4233). Now my ASP.NET Web Application dies trying to connect to SQL Server with an error "Invalid PInvoke metadata format". I have...
1
by: google_groups3 | last post by:
Has anybody ever used the (new) .NET connector from MySQL? I was just curious as to how good it was. Am i right o assume that it will still allow connections to non windows servers running MySQL...
1
by: Miku | last post by:
Hi Guies, I am new to vb.net. In my project I am using vb.net & MySql 4.0.17 as a backend. For database connectivity i have downloaded ByteFX - Mysql .net native provider. I have written the...
110
by: alf | last post by:
Hi, is it possible that due to OS crash or mysql itself crash or some e.g. SCSI failure to lose all the data stored in the table (let's say million of 1KB rows). In other words what is the worst...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.