These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: NHibernate and <connectionStrings> in web.config
PostPosted: Thu Jan 04, 2007 7:04 pm 
Beginner
Beginner

Joined: Thu Dec 21, 2006 11:38 am
Posts: 30
If I were to make a change to COnfiguration to allow for using a connection string from the <connectionStrings> section of the config file, how would I go about doing this?

Should I make the change and post the method code here?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 04, 2007 7:23 pm 
Beginner
Beginner

Joined: Thu Dec 21, 2006 11:38 am
Posts: 30
nm, i just found it!

may I add actual properties to the COnfiguration class for minimizing having to "know" what the properties all are?

in theory, having that loose coupling is nice, but we can also deprecate properties via Obsolete()...

Code:
public class Configuration

#if NET_2_0
/// <summary>
/// Gets or sets the Name of the Connection String from .NET Configuration <connectionStrings> section.
/// </summary>
/// <remarks>New to .NET 2.0, the configuration has a
/// &lt;connectionStrings&gt; section.  Refer to the documentation for the <connectionStrings> section.
public string ConnectionStringName
{
   get { return (string)this.Properties[Environment.ConnectionStringName]; }
   set { this.Properties[Environment.ConnectionStringName]=value; }
}
#endif

... and so forth


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.