5
Descargué System.Data.SQLite y traté de compilar el siguiente código de muestra.¿Cómo se usa System.Data.SQLite en mono?
using System; using System.Data; using System.Data.Common; using System.Data.SQLite; namespace test { class Program { static void Main(string[] args) { SQLiteConnection.CreateFile("/Users/smcho/Desktop/SQLite-1/example/mydatabasefile.db3"); } } }
Me corrió el siguiente comando
mcs db.cs -r:System.Data.dll -r:System.Data.SQLite.dll
Pero, tengo los mensajes de error de la siguiente manera.
** (/opt/local/lib/mono/1.0/mcs.exe:43249): WARNING **: The class System.Data.Common.DbConnection could not be loaded, used in System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 db.cs(12,7): error CS0103: The name `SQLiteConnection' does not exist in the current context Compilation failed: 1 error(s), 0 warnings
¿Qué podría estar mal?
mcs está muerto ahora (para .NET 1.x/Mono 1.x). debe utilizarse gmcs (para .NET 2.0 +/Mono 2.x). –