![]() |
|
|
|||||||
![]() |
Microsoft Certification - question about webconfigurationmanager.appsettings |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
This works in a C#ASP.NET Website application:
string strSQL = WebConfigurationManager.AppSettings["ConnString"].ToString(); However if I try using this statement in a c#dll class library, I get the error: 'Object Reference not set to an instance of an object' I've looked on the internet, and whilst a number of people have registered this problem, no-one has yet provided a solution. Can you provide one please? Regard, Ahmad =?Utf-8?B?QWhtYWQ=?= |
|
|
|
|
#2 |
|
Posts: n/a
|
Is it possible that C#DLL security settings are tighter than C#ASP.NET ones,
in the sense that the DLL(in its natural state) doesn't have permission to read a web.config file, whereas a C#ASP.NET file does? "Ahmad" wrote: > This works in a C#ASP.NET Website application: > string strSQL = WebConfigurationManager.AppSettings["ConnString"].ToString(); > > However if I try using this statement in a c#dll class library, I get the > error: > 'Object Reference not set to an instance of an object' > > I've looked on the internet, and whilst a number of people have registered > this problem, no-one has yet provided a solution. Can you provide one please? > > Regard, > > Ahmad =?Utf-8?B?QWhtYWQ=?= |
|
|
|
#3 |
|
Posts: n/a
|
"Ahmad" <> wrote in message news:7EC71689-050F-48B3-82FE-... > This works in a C#ASP.NET Website application: > string strSQL = WebConfigurationManager.AppSettings["ConnString"].ToString(); > > However if I try using this statement in a c#dll class library, I get the > error: > 'Object Reference not set to an instance of an object' > > I've looked on the internet, and whilst a number of people have registered > this problem, no-one has yet provided a solution. Can you provide one please? > > Regard, > > Ahmad Wrong newsgroup Jonathan Roberts |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re: Dial-up Modem Question | w_tom | A+ Certification | 0 | 09-18-2005 09:12 PM |
| "Installing two drives" question - what next? | Jim | A+ Certification | 12 | 08-07-2005 01:19 PM |
| Re: Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good | God | DVD Video | 3 | 04-25-2005 04:19 PM |
| Re: Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good | Filthy Mcnasty | DVD Video | 0 | 04-25-2005 04:29 AM |
| Re: Safe Mode Question (A+ question) | Gordon Findlay | A+ Certification | 0 | 06-16-2004 10:48 AM |