Merge pull request #1949 from lewurm/fixtype
[mono.git] / mcs / class / Mono.Data.Sqlite / Mono.Data.Sqlite_2.0 / SQLiteBase.cs
index e698dde9d6d208f21c70257a30d4a0e639624cbf..df8a5d787ab0daefe2ea5714dc621b1342f9f8b2 100644 (file)
@@ -206,8 +206,13 @@ namespace Mono.Data.Sqlite
 #if !SQLITE_STANDARD\r
         int n = UnsafeNativeMethods.sqlite3_close_interop(db);\r
 #else\r
-      ResetConnection(db);\r
-      int n = UnsafeNativeMethods.sqlite3_close(db);\r
+        ResetConnection(db);\r
+        int n;\r
+        try {\r
+          n = UnsafeNativeMethods.sqlite3_close_v2(db);\r
+        } catch (EntryPointNotFoundException) {\r
+          n = UnsafeNativeMethods.sqlite3_close(db);\r
+        }\r
 #endif\r
         if (n > 0) throw new SqliteException(n, SQLiteLastError(db));\r
       }\r