Single Application (DLL for "wrappers")

Posts   
1  /  2
 
    
Seth avatar
Seth
User
Posts: 204
Joined: 25-Mar-2006
# Posted on: 13-Jan-2009 21:06:12   

Not sure. Did you create the appropriate dll for the sql server schema? Does the sql server schema match the original schema? Also, you can step through the code to make sure it is doing the expected thing. Let me know.

normanlc
User
Posts: 62
Joined: 10-Jan-2007
# Posted on: 13-Jan-2009 21:48:24   

Seth wrote:

Not sure. Did you create the appropriate dll for the sql server schema? Does the sql server schema match the original schema? Also, you can step through the code to make sure it is doing the expected thing. Let me know.

Seth:

Originally I was playing with a Access database and created a new project. When I moved to a different database (MS SQL SERVER) it is a different schema (fyi: I'm not trying to use both databases - just working with the MsSqlServer one)... The LLBLGen Pro project was built with the Adapter as opposed to the Self-Serving. In the new C# project I added the same *.cs files for new project. I saved the config file with and without password to have the appropriate settings: Assembly, ObjectType, DataSource, ConnectionString and UseEncryption. That part loads fine (stepping through the debugger). So the Load works with and without password as expected.

I checked the variables during a step through (removing your attribute of DebuggerNonUserCode) to step through the Create() method, which is where the issue is located.

The _config loads fine; the assembly loads fine hitting the first condition if (File.Exists(_config.Assembly) as opposed to AppDomain... or the else (exception thrown)... then there is the declaration IDataAccessAdapter adapter;

It then enters the try {} catch {} section and comes out of the try block (without entering the catch block; however, the adapter is still null.

In reading the docs it states adapter = (IDataAccessAdapter)_assembly.CreateInstance(_config.ObjectType); will return null if the method is not found...

I checked in the debugger for the value of _config.ObjectType and it is "DataAccessAdapter" and I confirmed it exist in the DLL with .NET Reflector ...

And thus the next section where the SqlServerCompatibilityLevel is set crashes as the adapter is null.

You got me to looking about IoC and do you have any opinions about NInject?

Thanks again,

Norman

Seth avatar
Seth
User
Posts: 204
Joined: 25-Mar-2006
# Posted on: 13-Jan-2009 22:11:59   

You have to regenerate the data specific dll stuff for sql server. Also, the schemas must match pretty much exactly.

1  /  2