DAAB Works in One Class but not Another

Topics: Data Access Application Block, General discussion
Nov 23, 2008 at 8:58 PM
Hi.  I'm running into an issue using EntLib 4.0 DAAB.  If I have a single application which contains both a SQL Express .mdf database file and the DAAB logic/xml, I can connect successfully to the database using DAAB.  For example - If the application contains a function named 'GetCountries' which calls a SQL stored procedure, that function works just fine in the application.

However, I have a problem when the database file and DAAB logic/xml are in a class library referenced by another application, and the other application invokes the DAAB.  For example - The same 'GetCountries' function which worked when called within the same assembly now throws exceptions when another application calls it.  When another application makes that function call I get the error "The current build operation (build key Build Key[Microsoft.Practices.EnterpriseLibrary.Data.Database, null]) failed..."

It's as-though only the assembly containing the database & DAAB logic/xml can use DAAB.

How can I get around this issue?  I'm really in trouble if I can't figure this out, so I really appreciate any help with this.

Thanks,
Mike
Nov 24, 2008 at 3:14 AM
Hi Mike,

Its beacause that the class library cannot have a app.config, you can try putting your config file in the application that references the class library with your DAAB logic.

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com
Nov 25, 2008 at 1:42 AM

Thank you for that information!

From: AvanadeSupport [mailto:notifications@codeplex.com]
Sent: Sunday, November 23, 2008 9:14 PM
To: info@masonsolutions.net
Subject: SPAM-HIGH: Re: DAAB Works in One Class but not Another [entlib:40583]

From: AvanadeSupport

Hi Mike,

Its beacause that the class library cannot have a app.config, you can try putting your config file in the application that references the class library with your DAAB logic.

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Read the full discussion online.

To add a post to this discussion, reply to this email (entlib@discussions.codeplex.com)

To start a new discussion for this project, email entlib@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com