473,396 Members | 2,089 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,396 software developers and data experts.

Getting Error : Invalid PInvoke metadata format. while accessing mysql through Bytefx .net native provider

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 following code to connect with database:

Imports ByteFX.Data.MySqlClient
Imports System.Data
Public Class Form1
Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As
Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form
Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents Button1 As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
Me.Button1 = New System.Windows.Forms.Button()
Me.SuspendLayout()
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(64, 128)
Me.Button1.Name = "Button1"
Me.Button1.TabIndex = 0
Me.Button1.Text = "Button1"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(292, 273)
Me.Controls.AddRange(New System.Windows.Forms.Control()
{Me.Button1})
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)

End Sub

#End Region

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
Dim strConString As String
strConString = "Database=sona;server=localhost;uid=;pwd=;"
Dim con As New MySqlConnection(strConString)
con.Open()
MsgBox("Successful")
End Sub
End Class

When i run my application i get error at con.open() line as below:

An unhandled exception of type 'System.TypeLoadException' occurred in
system.dll

Additional information: Invalid PInvoke metadata format.

Pl. Help me out.

Regards,
Ban Miku
Nov 22 '05 #1
1 1537
Cor
Hi Miku,

Ask this also in the newsgroup

microsoft.public.dotnet.languages.vb

There is someone active in that newsgroup who loves PInvoke.

Cor
Nov 22 '05 #2

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

Similar topics

2
by: Dirk Reske | last post by:
Hello, I'm using the bytefx.data library to connect to a mysql server: string ConnectionString = "Server=localhost;Database=test;User Id=Freak;password=freak;"; IDbConnection dbConn; dbConn...
3
by: Muscha | last post by:
Hi, What is the best way to access mySql from C#? Anyone has a good suggestion about for a good data provider? Thanks, /m
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...
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...
6
by: Steven Caliendo | last post by:
Hi, I have a MySQL database on a remote server that I need to connect to. I can't seem to figure out what the connectionstring should be? I've searched through the help files, but all I can...
0
by: Don Lopez | last post by:
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...
5
by: asadikhan | last post by:
Hi, I am trying to configure my asp.net application to work with MySQL using Connector/NET and I wish to use connection pooling. What is the best way to do this? This is what I have so far: ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.