CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting
ASP.NET MVC Ready – 3 Months Free and Free Setup



Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > starter_kits_and_source_projects.microsoft_application_blocks Tags:
Item Type: NewsGroup Date Entered: 5/19/2006 6:43:40 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 2 Views: 53 Favorited: 0 Favorite
3 Items, 1 Pages 1 |< << Go >> >|
eggsovereasy
Asp.Net User
EL Jan 06: The value can not be null or an empty string.5/19/2006 6:43:40 PM

0

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.
Triax
Asp.Net User
Re: EL Jan 06: The value can not be null or an empty string.5/20/2006 10:19:31 PM

0

You are missing this line in your configuration file:

  <dataConfiguration defaultDatabase="Connection String"/>

Are you using the Enterprise Library Configuration Tool to edit your app.config file? I can't believe the tool wouldn't have added this for you...


Matthew Noonan

Noonan Consulting Inc.
EasyObjects.NET - The O/RM architecture for the Enterprise Library
Vertygo
Asp.Net User
Re: EL Jan 06: The value can not be null or an empty string.2/17/2007 2:50:30 PM

0

Thanks Triax I just had same problem with my ASP Ajax application. Entlib 2.0 config tool didnt added <dataConfiguration defaultDatabase="Connection String" /> line !
3 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Microsoft SQL Server 2005 For Dummies Authors: Andrew Watt, Pages: 406, Published: 2006
Designing Interfaces: Patterns for Effective Interaction Design Authors: Jenifer Tidwell, Pages: 331, Published: 2006
Web Technologies: A Computer Science Perspective Authors: Jeffrey C. Jackson, Pages: 574, Published: 2006
Beginning Apache Struts: From Novice to Professional Authors: Arnold Doray, Pages: 508, Published: 2006
The Java class libraries Authors: Patrick Chan, Rosanna Lee, Douglas Kramer, Pages: 1157, Published: 1999
The Java EE 5 Tutorial: For Sun Java System Application Server Platform Edition 9 Authors: Eric Jendrock, Jennifer Ball, Debbie Carson, Ian Evans, Scott Fordin, Kim Haase, Pages: 1304, Published: 2006

Web:
EL Jan 06: The value can not be null or an empty string. - ASP.NET ... 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 ...
JSF input conversion - empty string becomes zero instead of null I tried to provide my own converter, and I can convert the empty string into any value (say, -1 for example) but still not null! When my converter returns ...
Bob Beauchemin's Blog | SQL Server Spatial: EMPTY vs. NULL Jan 10, 2009 ... Because it is not database NULL, you can call methods on it without ... to me this sounds remarkably like the NULL vs empty string debate. ...
null String vs String "null" (Servlets forum at JavaRanch) Sep 24, 2008 ... So in this example, using the EL you'd get back the empty string. ... The current ranch time (not your local time) is Jan 12, 2009 08:06:32.
JavaServer Faces - Migr. to JSF 1.2 - InputText of Integer value ... Jan 8, 2009 ... The InputText tag use to return Null for an empty Integer value but returns a zero in .... javax.el.ELException: Function ':empty' not found ...
Ben Hall's Blog: C# Null Coalescing Operator (??) and String.Empty Oct 11, 2007 ... which says that if the value is not null, then use it otherwise use ... GetImportantString() returns string.empty if it cannot be found. ...
[#SPR-1671] Option to expose empty value instead of ... So, these values cannot be updated without some kind of workaround. ... As Juergen said, it makes sense to return null or an empty string rather than ...
PHP: NULL - Manual Jan 9, 2009 ... Null is the Constant in PHP. it is use to assign a empty value to the .... "text " . null --> string(4) "text" Finally, for those who do not ...
DANGER ! String.IsNullOrEmpty can lead to runtime Null exceptions ... Kalpesh, yes fo course you can assign a null to a string as it is a reference type. ... than just checking to see if a particular string has an empty value. ...
Mailing list archives Nov 1, 2006 ... getName() +" could not be retrieved as property was null. .... 0) { - throw new PropertyNotFoundException("Property name is an empty String. ...












access 97 help!!!!

dot matrix printing

am i the only one to find this impossible to use?

configuration error in uiprocess application block version 1.0.0.1

extending security application block - web.config

microsoft data access application block v2.0 x medium trust

deploying the enterprise library in production

find all the names with at least four given letters ?

user/server control exception

log4net and exception block..

difference between addinparameter and sqlparameter

sql server identity

saving state

custom publisher pattern question

has anyone used exception management...

ent-lib 2.0- problem configuring database listener for logging block

trying to use exception and logging application block in a website

run time exception

applicationblocks referencing issue

how to get starting with caching appllication block?

extend daab function to update/insert/delete dataset using sqlcommandbuilder ?

new to this block

send html formatted exception email?

how to handle decimal precision & scale with daab addoutparameter?

performance or me?

suggestion

configurationmanager

turn the daab to a web service ..

cachingconfiguration.config

retrieving data for a specific user

   
  Privacy | Contact Us
All Times Are GMT