Hi there,
I'm creating a new C# DNN module for out local intranet and want this module to be able to extract sql data from another sql server in our network using a custom sqldataprovider. I have created a new entry in my web.config a.i.
<data2 defaultProvider="DBSDataProvider">
<providers>
<clear/>
<add name="DBSDataProvider" type="DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider" connectionString="Data Source=sql2005test.kg.nl;Initial Catalog=DBS;User ID=*****;Password=*****" upgradeConnectionString="" objectQualifier="" databaseOwner="dbo"/>
</providers>
</data2>
in my dataprovider class
public class SqlDBSDataProvider : DBSDataProvider
{
#region Private Members
private const string ProviderType = "data2";
private const string ModuleQualifier = "";
private ProviderConfiguration _providerConfiguration = ProviderConfiguration.GetProviderConfiguration(ProviderType);
private string _connectionString;
private string _providerPath;
private string _objectQualifier;
private string _databaseOwner;
#endregion
#region Constructors
/// <summary>
/// Constructs new SqlDataProvider instance
/// </summary>
public SqlDBSDataProvider()
{
//Read the configuration specific information for this provider
Provider objProvider = (Provider)_providerConfiguration.Providers[_providerConfiguration.DefaultProvider];
and abstract dataprovider class
public abstract class DBSDataProvider
{
#region Shared/Static Methods
// singleton reference to the instantiated object
static DBSDataProvider objProvider = null;
// constructor
static DBSDataProvider()
{
CreateProvider();
}
// dynamically create provider
private static void CreateProvider()
{
objProvider = (DBSDataProvider)Reflection.CreateObject("data2", "DBSDataProvider", "KG.Modules.DBS", "");
}
Can anyone please tell me what's wrong here? I can't seem to use this custom dataprovider.
Any help will be greatly appreasiated.
Thanks,
Mark van den Broek
MCAD, the Netherlands