0

I want to use MySQL like SQL Compact Edition! In other words, I want to create a local database (compact database file) by MySQL csharp drivers in from Connector/Net .

In my project we need first to install MySql.Data.dll in the GAC and my Data Source is a file path like: D:\MyDatabase\database.myd

Now my codes must be like this:

 using System;
 using System.Data;
 using MySql.Data.MySqlClient;

 public class Test
 {
    public static void Main(string[] args)
    {
       string strConnection = "CREATE DATABASE TestDatabase;";

       MySqlConnection conDatabase = new MySqlConnection("Data Source=D:\MyDatabase\database.myd;Persist Security Info=yes");

       MySqlCommand cmdDatabase = new MySqlCommand(strConnection, conDatabase);

       conDatabase.Open();
       cmdDatabase.ExecuteNonQuery();
       conDatabase.Close();
    }
 }

Can I do it ?

Behzad
  • 3,502
  • 4
  • 36
  • 63

1 Answers1

0

I did research on the internet and realized that MySQL can not be compact and I use Sqlite instead of MySQL.

Some compact databases:

  • Firebird
  • SQL Server CE
  • Sqlite
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Behzad
  • 3,502
  • 4
  • 36
  • 63