DataSource with Adapter and Multiple databases

Posts   
 
    
dravidian
User
Posts: 10
Joined: 31-Dec-2007
# Posted on: 15-Jan-2008 06:08:49   

Hi there,

I'm evaluating LLBLGen Pro 2.5 Demo.

I've got my DAL code which was generated against 1 database with 2 separate schemas. I will be splitting the 2 schemas into 2 different databases later on, and was using the DataAccessAdapterFactory method to allow for multiple databases, and catalog and schema renaming for when I eventually split the DB.

I was checking out the DataSource control and I was wondering if there is a way for me to specify a DataAccessAdapter that the control uses? Right now it seems that it uses the DBSpecific.DataAccessAdapter which uses the default connection.

Thanks in advance!

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 15-Jan-2008 08:51:11   

Please use myLLBLGenProDataSource.AdapterToUse property.

dravidian
User
Posts: 10
Joined: 31-Dec-2007
# Posted on: 15-Jan-2008 16:41:10   

Thanks! I'll try this out when I get home.

I thought for sure this would something that the control didnt support but I was proven wrong. So far I'm very impressed with how thorough LLBLGen is!

dravidian
User
Posts: 10
Joined: 31-Dec-2007
# Posted on: 17-Jan-2008 05:05:43   

So I just tried this out and I'm getting a Security Exception see below.

I'm running my web app under medium trust locally, since my hosting provider restricts me to running my web apps under medium trust.

When I switch my app to full trust in the web.config, the Datasource control works fine.

Any thoughts on whether I can get around this somehow?

Below is the exception information:


[SecurityException: Request failed.]
   System.Reflection.CustomAttribute._CreateCaObject(Void* pModule, Void* pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs) +0
   System.Reflection.CustomAttribute.CreateCaObject(Module module, RuntimeMethodHandle ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs) +104
   System.Reflection.CustomAttribute.GetCustomAttributes(Module decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes) +482
   System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit) +258
   System.RuntimeType.GetCustomAttributes(Type attributeType, Boolean inherit) +63
   System.ComponentModel.ReflectTypeDescriptionProvider.ReflectGetAttributes(Type type) +262
   System.ComponentModel.ReflectedTypeData.GetAttributes() +64
   System.ComponentModel.DefaultTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetAttributes() +50
   System.ComponentModel.TypeDescriptor.GetAttributes(Type componentType) +26
   System.ComponentModel.ReflectedTypeData.GetConverter(Object instance) +274
   System.ComponentModel.DefaultTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetConverter() +55
   System.ComponentModel.TypeDescriptor.GetConverter(Type type) +17
   System.Web.UI.ObjectStateFormatter.SerializeValue(SerializerBinaryWriter writer, Object value) +2261


Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 17-Jan-2008 10:54:12   

Please compile your own generated code with the attribute: [assembly: AllowPartiallyTrustedCallers()] ref: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=8759

Also you might need to check the following thread: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=12078