we have diff. databases outside our DNN db. example: ordering, warehouse. ect. I can add the connections in the web.conf. but how would I get the DataContext.Instance() to point to one of those db or can you not use this class method. we will be calling primarily Stored Procedures.
Public Shared Function GetEntry(ByVal entryId As Integer, ByVal moduleId As Integer) As ApplicationsInfo Dim entry As ApplicationsInfo
Using ctx As IDataContext = DataContext.Instance() Dim rep = ctx.GetRepository(Of ApplicationsInfo)() entry = rep.GetById(entryId, moduleId) End Using
Return entry End Function
thanks
Doug
There's an overload of <code>DataContext.Instance</code> that takes the connection string name.
thanks for the quick reply and I see the fuction, but how would I code that?
Public Shared Function Instance() As IDataContext Public Shared Function Instance(connectionStringName As String) As IDataContext
DataContext.Instance("NewConnectionString") doesn't work.
I would expect <code>DataContext.Instance("NewConnectionString")</code> to work, what error are you getting?
I got it working. had to add ref. to PetaPoco.
thanks for your help
These Forums are for the discussion of the open source CMS DNN platform and ecosystem.
For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:
Awesome! Simply post in the forums using the link below and we'll get you started.