Try our conversational search powered by Generative AI!

Using DDS outside of EPiServer


I would like to know if it is possible to use DDS from another non EPiServer website.

I would like to move some web services from an existing episerver website into another website which has its own application pool.


As far as im aware, there are a couple of ways of doing this.

1. Use the DDS API's from the EPiServer dll's in the separate services website.

2. Insert data into DDS by calling directly the stored procedures created in the database for each user data store (i.e Save_MyDataStore).


I think there could be a couple of issues with these two methods:

1. Using the DDS API's - I don't know whether I will need an EPiServer licence in the website to run this.

2. Using the stored procedures - is this safe? The only concern I have is with the caching EPiServer does. I guess caching will be ok as long as the DDS cache on the website uses an SQL dependency.


Has anyone implemented something like this before or can comment on the above?




Jun 24, 2013 11:26

Hi Adam!

Last time I checked there where no check for license in EPiServer.Data.dll (or dependent assemblies) so it should work to run them in a separate instance but you will never get any guaranties the they will not add license checks in the future.

If you update the database directly you will run into problem because DDS does not use a SQL Dependencies.

You will probably need to add EPiServer.Data, EPiServer.Framework, EPiServer.Data.Cache and EPiServer.Events to you service, sprinkle with some configuration (connectionStrings, WCF for EPiServer Events, etc).

At least for the first version of the DDS, Paul Smith published s Unit Test project that run separatly. It can be downloaded here.

Please let us know the results of your tests!

Jun 24, 2013 16:13

Thanks Fredrik - I'll have a look and let you know how we get on.

Jun 25, 2013 11:54
Edited, Jun 25, 2013 20:17

Thanks Valdis - I am working with Joel on this (who has commented on your blog post).

I think we are running into structure map issues as we are using EPiServer 7 (so the episerver 7 dlls for data etc).

Have you been able to get this working against an EPiServer 7 instance of DDS?



Jun 27, 2013 12:19

Great. This was used in CMS6. I'll check what's the case in v7. StructureMap needs to be initialized beforehand using any base classes as most of the interfaces are retrieved via ServiceLocator.

Jun 27, 2013 13:12

Try this code:

var container = new Container();
var factory = new SqlDatabaseFactory();
container.Configure(ce => ce.For<IDatabaseHandler>().Use(factory.CreateDefaultHandler));
ServiceLocator.SetLocator(new StructureMapServiceLocator(container));

// if you need caching - replace `null'
DataInitialization.InitializeFromCode(container, factory, null);
var store = typeof(SampleModel).GetStore();



NB! <episerver.dataStore> element for v7 is optional. If you still add it - be sure to clear providers list before adding - otherwise you will get "Key has already been added" type of exception.

Jun 27, 2013 16:04

Hi Valdis,

Well that certainly seems to be doing the trick! Now we are successfully writing to DDS outside of an EPiServer website.

I wondered why I was getting those key already added errors and didn't realise that the <episerver.datastore> section was optional in v7.

Thanks very much for your help. It all looks so simple when you know what you are doing!



Edited, Jun 27, 2013 18:06

Can you get data from the DDS using an internal webservice?

I seem to be getting zero items back but using the same code on a normal page I get results.


Nov 20, 2014 18:18
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.