Massive with Sql CE 4.0 - Provider Tweak #113

Merged
merged 1 commit into from Dec 29, 2011
View
@@ -119,6 +119,10 @@ public class DynamicModel : DynamicObject {
PrimaryKeyField = string.IsNullOrEmpty(primaryKeyField) ? "ID" : primaryKeyField;
DescriptorField = descriptorField;
var _providerName = "System.Data.SqlClient";
+
+ if(ConfigurationManager.ConnectionStrings[connectionStringName].ProviderName != null)
+ _providerName = ConfigurationManager.ConnectionStrings[connectionStringName].ProviderName;
+
_factory = DbProviderFactories.GetFactory(_providerName);
ConnectionString = ConfigurationManager.ConnectionStrings[connectionStringName].ConnectionString;
}