This has happened to me at home several times with a website I was trying to build and eventually gave up because I could find nothing about it. However, now I am at work and I am getting this same exception that makes no sense.
Here is the app.config section that is importent:
<configuration>
<configSections>
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" />
</configSections>
<connectionStrings>
<add name="Connection String" connectionString="Data Source=[REMOVED];Initial Catalog=NIDB;User ID=[REMOVED];Password=[REMOVED];"
providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
And here is the pretinent C# code, still very early so I don't have stored procedures yet, but that is good because you can see the sql.
public static DataSet GetAll()
{
string sql = "SELECT main_entry, article_id FROM ARTICLE";
return DatabaseFactory.CreateDatabase().ExecuteDataSet(CommandType.Text, sql);
}
But when I run it I get an ArgumentException that says: "The value can not be null or an empty string." where I run the DatabaseFactory stuff. What am I doing wrong?
I know this is a windows form (hence app.config), but it should work fine anyway right? I'm using EL in 2 large webpojects at work and it works perfectly, but like I said it does this same crap at home when I try to use my host's sql server.