473,785 Members | 2,867 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

InvalidOperatio nException: GetConfig was called during configuration initialization

hello!

I have this code:

public static DataSet DSet(String sql)
{
OleDbConnection con = new OleDbConnection ();
con.ConnectionS tring =
ConfigurationSe ttings.AppSetti ngs["conString"];
OleDbCommand cmd = new OleDbCommand(sq l,con);
OleDbDataAdapte r adp = new OleDbDataAdapte r(cmd);
DataSet ds = new DataSet();
adp.Fill(ds);
return ds;
}

it ran fine untill about yesterday, but suddnely now i always get an
InvalidOperatio Exception (referring to the second line of the
function)... the
help text is: GetConfig was called during configuration initialization

i have no idea why is suddnely started appearing... please help!
thanks!

Best Regards,
Kosta.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
1 1485
I had the same problem this week when I attempted converting and subsequently
running my C# app developed under Visual Studio 2003, to the Beta of C# 2005
Express

It was in a similar place too, when setting the connection string of a
database connection, although my code didnt attempt to pull the connection
string from the config file.

I eventually tracked it down to being caused by bad/invalid text in the
app.config file. In the configSections I had a section with a name
containing spaces and commas, this seemed to be the culprit. I tried a
number of variations and found this was the cause of my grief, so I assume
C#2.0/.NET 2.0 is a bit more picky about the structure of the file. In my
case, I wasnt even accessing the section, but I can only assume that setting
the connection string of SqlConnection shomehow forces the reading/validating
of the config file.

Hope this helps

Ms Jackson

"kosta" wrote:
hello!

I have this code:

public static DataSet DSet(String sql)
{
OleDbConnection con = new OleDbConnection ();
con.ConnectionS tring =
ConfigurationSe ttings.AppSetti ngs["conString"];
OleDbCommand cmd = new OleDbCommand(sq l,con);
OleDbDataAdapte r adp = new OleDbDataAdapte r(cmd);
DataSet ds = new DataSet();
adp.Fill(ds);
return ds;
}

it ran fine untill about yesterday, but suddnely now i always get an
InvalidOperatio Exception (referring to the second line of the
function)... the
help text is: GetConfig was called during configuration initialization

i have no idea why is suddnely started appearing... please help!
thanks!

Best Regards,
Kosta.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
6548
by: phark52 | last post by:
My main app calls LoadLibrary() to load a DLL, which calls CreateThread(). This does NOT return NULL and I get a thread ID. However, ThreadProc never gets executed when this code is in the DLL. It works fine in the standalone EXE source. I put example code below. #define MB(msg) MessageBox(0, msg, "", MB_OK|MB_ICONINFORMATION); DWORD APIENTRY tproc() {
4
1662
by: Abdessamad Belangour | last post by:
Hi all, I have an ArrayList ( phoneBook ) of structures (PhoneEntry's) holding the name and the owned phone numbers of a person as in below : -------------------------------------------------------------------------- //------a strcuture holding the name and the phones of a person------ struct PhoneEntry { string name, ArrayList phoneNumbers; public PhoneEntry(string nm, ArrayList pn) { name=nm;
9
5079
by: james | last post by:
According to the documentation ConfigurationSetting.GetConfig( string ) is used to get user defined config settings. Yet, no matter how I try to add my own sections to the app.config I keep getting errors stating an invalid config file section found. So, can someone elighten me as to how this is to be used ?? thanks JIM
0
904
by: kosta | last post by:
hello! I have this code: public static DataSet DSet(String sql) { OleDbConnection con = new OleDbConnection(); con.ConnectionString = ConfigurationSettings.AppSettings; OleDbCommand cmd = new OleDbCommand(sql,con);
2
6409
by: Mythran | last post by:
public static void Main() { string sectionName = "system.web"; object settings = ConfigurationSettings.GetConfig(sectionName); Console.WriteLine( settings == null ? "(null)" : settings.GetType().ToString() ); }
0
2171
by: LJ | last post by:
I have been getting this message and can't resolve the problem. I have checked the AntiVirus software and added the application directory to the exculsion list. The application is on a web farm, using SANS for file storage. It seemed to start once we installed the SSL cert. But, that could be just when we noticed the problem. Any ideas would be greatly appreciated. Thanks <!ljr!>
6
6121
by: Tony | last post by:
Dear All, When I run an example program on the http://www.dotnetjunkies.com/quickstart/util/srcview.aspx?path=/quickstart/aspplus/samples/webforms/data/datagrid1.src&file=VB\datagrid1.aspx&font=3 I received an error message: "The ConnectionString property has not been initialized.
1
1498
by: Ken Jones | last post by:
Hi all, I am new to VB.NET and would like to get some help. I have a VB.NET Windows application that connects to my development SQLServer during development. I use the VS 2005 designer to create the DataSet (via Add Data Connection) that points to my development SQL Server and drag the fields and drop them to my forms and reports. The problem I have is that the application cannot be deployed since the
2
4312
by: Jeroen | last post by:
We are experiencing a tuff-to-debug problem ever since we introduced a WebBrowser control into our failry large application. I'm not sure if the problem description below contains enough details, so if I need to elaborate on something please ask for it. We have a UserControl with a WebBrowser on it. This UserControl is instantiated a few times during the program run, depending on user interaction. The WebBrowser then navigates to a local...
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10329
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10152
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8974
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7500
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2880
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.