diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs
index 16e560c6df..5b71897ced 100644
--- a/OpenSim/Data/SQLite/SQLiteAssetData.cs
+++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs
@@ -30,7 +30,12 @@ using System.Data;
using System.Reflection;
using System.Collections.Generic;
using log4net;
-using Mono.Data.Sqlite;
+#if CSharpSqlite
+ using Community.CsharpSqlite.Sqlite;
+#else
+ using Mono.Data.Sqlite;
+#endif
+
using OpenMetaverse;
using OpenSim.Framework;
diff --git a/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs b/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs
index a1412ff0fa..c54bd743b3 100644
--- a/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs
+++ b/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs
@@ -33,7 +33,12 @@ using System.Reflection;
using log4net;
using OpenMetaverse;
using OpenSim.Framework;
-using Mono.Data.Sqlite;
+using log4net;
+#if CSharpSqlite
+ using Community.CsharpSqlite.Sqlite;
+#else
+ using Mono.Data.Sqlite;
+#endif
namespace OpenSim.Data.SQLite
{
diff --git a/OpenSim/Data/SQLite/SQLiteAvatarData.cs b/OpenSim/Data/SQLite/SQLiteAvatarData.cs
index c093884db4..60a1a3e9f7 100644
--- a/OpenSim/Data/SQLite/SQLiteAvatarData.cs
+++ b/OpenSim/Data/SQLite/SQLiteAvatarData.cs
@@ -33,7 +33,11 @@ using System.Threading;
using log4net;
using OpenMetaverse;
using OpenSim.Framework;
-using Mono.Data.Sqlite;
+#if CSharpSqlite
+ using Community.CsharpSqlite.Sqlite;
+#else
+ using Mono.Data.Sqlite;
+#endif
namespace OpenSim.Data.SQLite
{
diff --git a/OpenSim/Data/SQLite/SQLiteEstateData.cs b/OpenSim/Data/SQLite/SQLiteEstateData.cs
index d1d67ebdab..21556da99e 100644
--- a/OpenSim/Data/SQLite/SQLiteEstateData.cs
+++ b/OpenSim/Data/SQLite/SQLiteEstateData.cs
@@ -30,7 +30,11 @@ using System.Collections.Generic;
using System.Data;
using System.Reflection;
using log4net;
-using Mono.Data.Sqlite;
+#if CSharpSqlite
+ using Community.CsharpSqlite.Sqlite;
+#else
+ using Mono.Data.Sqlite;
+#endif
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces;
diff --git a/OpenSim/Data/SQLite/SQLiteFramework.cs b/OpenSim/Data/SQLite/SQLiteFramework.cs
index cf114d1a07..4992bcc7de 100644
--- a/OpenSim/Data/SQLite/SQLiteFramework.cs
+++ b/OpenSim/Data/SQLite/SQLiteFramework.cs
@@ -31,7 +31,11 @@ using System.Collections.Generic;
using System.Data;
using OpenMetaverse;
using OpenSim.Framework;
-using Mono.Data.Sqlite;
+#if CSharpSqlite
+ using Community.CsharpSqlite.Sqlite;
+#else
+ using Mono.Data.Sqlite;
+#endif
namespace OpenSim.Data.SQLite
{
diff --git a/OpenSim/Data/SQLite/SQLiteFriendsData.cs b/OpenSim/Data/SQLite/SQLiteFriendsData.cs
index b06853ce68..4bfd228364 100644
--- a/OpenSim/Data/SQLite/SQLiteFriendsData.cs
+++ b/OpenSim/Data/SQLite/SQLiteFriendsData.cs
@@ -31,7 +31,11 @@ using System.Collections.Generic;
using System.Data;
using OpenMetaverse;
using OpenSim.Framework;
-using Mono.Data.Sqlite;
+#if CSharpSqlite
+ using Community.CsharpSqlite.Sqlite;
+#else
+ using Mono.Data.Sqlite;
+#endif
namespace OpenSim.Data.SQLite
{
diff --git a/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs b/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs
index 9b8e2fa7f3..0d7b001e3f 100644
--- a/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs
+++ b/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs
@@ -30,7 +30,11 @@ using System.Collections.Generic;
using System.Data;
using System.Reflection;
using log4net;
-using Mono.Data.Sqlite;
+#if CSharpSqlite
+ using Community.CsharpSqlite.Sqlite;
+#else
+ using Mono.Data.Sqlite;
+#endif
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces;
diff --git a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs
index ecf8e02c34..d606f118ee 100644
--- a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs
+++ b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs
@@ -30,7 +30,11 @@ using System.Collections.Generic;
using System.Data;
using System.Reflection;
using log4net;
-using Mono.Data.Sqlite;
+#if CSharpSqlite
+ using Community.CsharpSqlite.Sqlite;
+#else
+ using Mono.Data.Sqlite;
+#endif
using OpenMetaverse;
using OpenSim.Framework;
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
index ebe6da8601..9d49fb681f 100644
--- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs
+++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
@@ -32,7 +32,11 @@ using System.Drawing;
using System.IO;
using System.Reflection;
using log4net;
-using Mono.Data.Sqlite;
+#if CSharpSqlite
+ using Community.CsharpSqlite.Sqlite;
+#else
+ using Mono.Data.Sqlite;
+#endif
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using OpenSim.Framework;
diff --git a/OpenSim/Data/SQLite/SQLiteUserAccountData.cs b/OpenSim/Data/SQLite/SQLiteUserAccountData.cs
index 2706aea257..7a5de5073d 100644
--- a/OpenSim/Data/SQLite/SQLiteUserAccountData.cs
+++ b/OpenSim/Data/SQLite/SQLiteUserAccountData.cs
@@ -31,7 +31,11 @@ using System.Collections.Generic;
using System.Data;
using OpenMetaverse;
using OpenSim.Framework;
-using Mono.Data.Sqlite;
+#if CSharpSqlite
+ using Community.CsharpSqlite.Sqlite;
+#else
+ using Mono.Data.Sqlite;
+#endif
namespace OpenSim.Data.SQLite
{
diff --git a/OpenSim/Data/SQLite/SQLiteUtils.cs b/OpenSim/Data/SQLite/SQLiteUtils.cs
index 07c6b69a3b..ca5861fefd 100644
--- a/OpenSim/Data/SQLite/SQLiteUtils.cs
+++ b/OpenSim/Data/SQLite/SQLiteUtils.cs
@@ -27,7 +27,11 @@
using System;
using System.Data;
-using Mono.Data.Sqlite;
+#if CSharpSqlite
+ using Community.CsharpSqlite.Sqlite;
+#else
+ using Mono.Data.Sqlite;
+#endif
namespace OpenSim.Data.SQLite
{
diff --git a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs
index ca651e1998..ccbd86e119 100644
--- a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs
+++ b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs
@@ -29,7 +29,11 @@ using System;
using System.Data;
using System.Reflection;
using System.Collections.Generic;
-using Mono.Data.Sqlite;
+#if CSharpSqlite
+ using Community.CsharpSqlite.Sqlite;
+#else
+ using Mono.Data.Sqlite;
+#endif
using log4net;
using OpenMetaverse;
using OpenSim.Framework;
diff --git a/prebuild.xml b/prebuild.xml
index 726991c4a1..530c417d80 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -2217,6 +2217,8 @@
+
+