Why do I need to move config file to host when using Data Access B


M

Mike

Hi! I have a component that references Microsoft Data Access Application
block. I wrote a desktop client to test this component. I had to place the
same settings I use in the component to the client's app.config file
including

<configSections>
<section name="dataConfiguration"
type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings,
Microsoft.Practices.EnterpriseLibrary.Data, Version=3.1.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" />
</configSections>
<dataConfiguration defaultDatabase="MyDb" />
<connectionStrings>
<add name="MyDb" connectionString="Data Source=localhost; Initial
Catalog=DEV; Integrated Security=SSPI; Connection Timeout=360;Max Pool
Size=1500"
providerName="System.Data.SqlClient" />
</connectionStrings>
*******************************************

My question is why I had to do it to make it work? Why can't my client just
use the block? Is there a workaround that? What am I doing wrong?

Any ideas are greatly appreciated.
Many thanks in advance,
 
Ad

Advertisements

A

Andy O'Neill

Mike said:
Hi! I have a component that references Microsoft Data Access Application
block. I wrote a desktop client to test this component. I had to place the
same settings I use in the component to the client's app.config file
including

<configSections>
<section name="dataConfiguration"
type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings,
Microsoft.Practices.EnterpriseLibrary.Data, Version=3.1.0.0,
Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" />
</configSections>
<dataConfiguration defaultDatabase="MyDb" />
<connectionStrings>
<add name="MyDb" connectionString="Data Source=localhost; Initial
Catalog=DEV; Integrated Security=SSPI; Connection Timeout=360;Max Pool
Size=1500"
providerName="System.Data.SqlClient" />
</connectionStrings>
*******************************************

My question is why I had to do it to make it work? Why can't my client
just
use the block? Is there a workaround that? What am I doing wrong?

Any ideas are greatly appreciated.
Many thanks in advance,
Your first mistake, imo, is in using enterprise library at all.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top