Embeded MySQL with C#

  • Thread starter Thread starter Ümit Kavala
  • Start date Start date
Ü

Ümit Kavala

I wrote an application using c# and mySQL database. But when I deploy it
doesn't work on an other PC. How can I embed mysql in C#. A code example
will be quite helpful for me.
Any help wll be appreciated.
 
Hi Umit,

What do you mean by 'doesn't work'? That can have a million different
meanings.

Have you installed MySQL on the end user's machine and created a database
for your application there?

-Altaf
 
I wrote an application using c# and mySQL database. But when I deploy it
doesn't work on an other PC. How can I embed mysql in C#.

I think you have a fundamental misunderstanding of what mySql is or rather,
much more importantly, what it is not.

Like SQL Server and Oracle, etc, it is a server-based RDBMS. It is not the
same as, say, an Access database in this respect. You can't "embed" it in C#
as such.

You need to install mySql on a server which is "visible" to your client(s) -
this could be on a server local to their network, or on the Internet. If
this is a WinForms app, the client machine(s) will need at least the .Net
Framework installed and a reasonably recent version of MDAC. If this is a
WebForms app, your webserver will similarly need a resonably recent version
of MDAC - your sebserver will already have the .NET Framework installed as
part of the IIS installation.

Luckily, once this is in place, interfacing with mySql in the .NET world is
relatively simple - all you require is a .NET data provider. There are
several native .NET data providers available, as well as OleDb providers and
even ODBC drivers.

You will also need some mechanism of telling the client(s) how to connect to
the mySql database - this is achieved by means of a connection string.

So...

1) Where is the mySql server?

2) Is this a WinForms or WebForms app?

3) What .NET data provider are you using?
 
I'm getting a strange error when trying to call the Embedded MySQL API
from C#. I've modified the code to use "libmySQLd.dll"
 
In fact, MySql can be embedded in an application; at least in a C/C++
application. So, in theory can be embedded also in a managed application.

Dumitru
 
Back
Top