![]() |
|
|
|||||||
![]() |
ASP Net - Getting Connection String from Web.Config in ASP.NET Express |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
I'm trying to get the frickin string out of the frickin config file
(using VB), but foundation classes don't seem to match the documentation. Either I have this 30 line example where I walk a collection fished out from nine levels down or I have a C# example (Programming ASP.NET 2.0, Core Reference): connstr = ConfigurationManager.ConnectionStrings["NWind"].ConnectionString; Which is nice but flat out doesn't match reality (but I sure wish it did). So how do you guys cope with this? PS: I'm trying to store the connection in the application (Global.aspx) so I can reuse it. That's how I used to do it in the old ASP days. Is that how it's still done? Mark |
|
|
|
|
#2 |
|
Posts: n/a
|
If you're using VB, change the brackets to parentheses. Otherwise, this is
how I get the ConnectionString out of the config file. As for putting stuff in the GLOBAL.ASAX file, don't do it. -- Christopher A. Reed "The oxen are slow, but the earth is patient." "Mark" <> wrote in message news: oups.com... > I'm trying to get the frickin string out of the frickin config file > (using VB), but foundation classes don't seem to match the > documentation. Either I have this 30 line example where I walk a > collection fished out from nine levels down or I have a C# example > (Programming ASP.NET 2.0, Core Reference): > > connstr = > ConfigurationManager.ConnectionStrings["NWind"].ConnectionString; > > Which is nice but flat out doesn't match reality (but I sure wish it > did). > > So how do you guys cope with this? PS: I'm trying to store the > connection in the application (Global.aspx) so I can reuse it. That's > how I used to do it in the old ASP days. Is that how it's still done? > Christopher Reed |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Give you enough string functions in Java web reporting tool | freezea | Software | 0 | 10-08-2009 09:03 AM |
| Java String Problems | rbnbenjamin | General Help Related Topics | 0 | 02-03-2009 11:02 PM |
| Connection string | Rucheekaa | Software | 0 | 06-14-2008 04:02 AM |
| ASP.NET: Asign Users in Roles(Array.IndexOf(Of String) method) | msandlana | Software | 0 | 04-25-2008 06:37 AM |
| How to configure VPN | hi5 | Hardware | 1 | 07-09-2007 12:21 PM |