2010-06-04 12 views
5

मैंने System.Data.SQLite डाउनलोड किया, और निम्न नमूना कोड संकलित करने का प्रयास किया।मोनो के तहत System.Data.SQLite का उपयोग कैसे करें?

 
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"); 
    } 
    } 
} 

मैं निम्न आदेश

 
mcs db.cs -r:System.Data.dll -r:System.Data.SQLite.dll 

भाग गया लेकिन, इस प्रकार मैं त्रुटि संदेश मिल गया।

 
** (/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 

क्या गलत हो सकता है?

उत्तर

4

एमसीएस के बजाय जीएमसीएस का उपयोग इस मुद्दे को हल किया।

 
gmcs db.cs -r:System.Data.dll,System.Data.SQLite.dll 
+0

एमसीएस अब मर चुका है (.NET 1.x/Mono 1.x के लिए)। जीएमसीएस का उपयोग किया जाना चाहिए (.NET 2.0 +/मोनो 2.x के लिए)। –

संबंधित मुद्दे