CreateDatabase() not working?

Topics: Data Access Application Block, General discussion
May 25, 2009 at 8:54 AM

Hi

When I use the following line, I get the following error at runtime. Am I missing something?

<font size="2" color="#008080"><font size="2" color="#008080">

Database

</font></font><font size="2" color="#008080">

 

</font>

db = DatabaseFactory.CreateDatabase();

ArgumanetException was unhandled by user. The value cannot be null or an empty string.

My app.config file below:

<font size="2" color="#0000ff"><font size="2" color="#0000ff">

<?

</font></font><font size="2" color="#0000ff">

 

</font>

xml version="1.0" encoding="utf-8"?><font size="2" color="#0000ff"><font size="2" color="#0000ff">

<

</font></font><font size="2" color="#0000ff">

 

</font>

configuration><font size="2" color="#0000ff"><font size="2" color="#0000ff">

<

</font></font><font size="2" color="#0000ff">

 

</font>

configSections><font size="2" color="#0000ff"><font size="2" color="#0000ff">

<

</font></font><font size="2" color="#0000ff">

 

</font>

section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /><font size="2" color="#0000ff"><font size="2" color="#0000ff">

</

</font></font><font size="2" color="#0000ff">

 

</font>

configSections><font size="2" color="#0000ff"><font size="2" color="#0000ff">

<

</font></font><font size="2" color="#0000ff">

 

</font>

connectionStrings><font size="2" color="#0000ff"><font size="2" color="#0000ff">

<

</font></font><font size="2" color="#0000ff">

 

</font>

add name="PortMan.Properties.Settings.PortManConnectionString"

<font size="2" color="#0000ff"><font size="2" color="#0000ff">

 

</font></font>
<font size="2" color="#0000ff">

 

</font>

connectionString="Data Source=(local)\SQLEXPRESS;Initial Catalog=PortMan;Integrated Security=SSPI"

<font size="2" color="#0000ff"><font size="2" color="#0000ff">

 

</font></font>
<font size="2" color="#0000ff">

 

</font>

providerName="System.Data.SqlClient" /><font size="2" color="#0000ff"><font size="2" color="#0000ff">

</

</font></font><font size="2" color="#0000ff">

 

</font>

connectionStrings><font size="2" color="#0000ff"><font size="2" color="#0000ff">

</

</font></font><font size="2" color="#0000ff">

 

</font>

configuration>

I am busy with a WinApp drillthrough report, and for some reason whatever I do the child-report is either empty or contains all the data in the datatable. I believe it has to do with the parameter. Therefor I am trying to create the report with EntLib. Can you please give me some guidance how I should approach the scenario.

Many thanx

 

May 25, 2009 at 9:38 AM

Hi,

If you are using the CreateDatabase() without the parameter, make sure that you specify the default database in your config. And in the config you've provided, I cant seem to find that you have a default database.

 

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