473,387 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

A first chance exception of type 'System.InvalidOperationException

Hi all

I get the following error:
'A first chance exception of type 'System.InvalidOperationException'
occurred in system.dll

Additional information: The requested Performance Counter is not a custom
counter, it has to be initialized as ReadOnly.'
My code c#:
using Microsoft.Practices.EnterpriseLibrary.Data;
....
private DataSet ds;
private Database db;
db = DatabaseFactory.CreateDatabase();
string sqlCommand = "Select...";
DBCommandWrapper dbCommandWrapper = db.GetSqlStringCommandWrapper(sqlCommand);
ds = db.ExecuteDataSet(dbCommandWrapper);

Any ideas??? Thank you in advance.

Nov 17 '05 #1
2 18873
Hi,

My guess is that you compile the enterprise library with performance
counters enabled and that you fail to perform some required action to
install those counters on your system. I vaguely remember there is a
compiler variable that enables or disables the use of performance counters
in Enterprise Library.

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]
"Juanjo" <Ju****@discussions.microsoft.com> wrote in message
news:99**********************************@microsof t.com...
Hi all

I get the following error:
'A first chance exception of type 'System.InvalidOperationException'
occurred in system.dll

Additional information: The requested Performance Counter is not a custom
counter, it has to be initialized as ReadOnly.'
My code c#:
using Microsoft.Practices.EnterpriseLibrary.Data;
...
private DataSet ds;
private Database db;
db = DatabaseFactory.CreateDatabase();
string sqlCommand = "Select...";
DBCommandWrapper dbCommandWrapper =
db.GetSqlStringCommandWrapper(sqlCommand);
ds = db.ExecuteDataSet(dbCommandWrapper);

Any ideas??? Thank you in advance.


Nov 17 '05 #2
Dmytro, you are right!

After your reply, i found this post:
http://dotnetjunkies.com/WebLog/ssko.../25/61376.aspx

I hope it was usefull for people.

Regards,

"Dmytro Lapshyn [MVP]" wrote:
Hi,

My guess is that you compile the enterprise library with performance
counters enabled and that you fail to perform some required action to
install those counters on your system. I vaguely remember there is a
compiler variable that enables or disables the use of performance counters
in Enterprise Library.

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]
"Juanjo" <Ju****@discussions.microsoft.com> wrote in message
news:99**********************************@microsof t.com...
Hi all

I get the following error:
'A first chance exception of type 'System.InvalidOperationException'
occurred in system.dll

Additional information: The requested Performance Counter is not a custom
counter, it has to be initialized as ReadOnly.'
My code c#:
using Microsoft.Practices.EnterpriseLibrary.Data;
...
private DataSet ds;
private Database db;
db = DatabaseFactory.CreateDatabase();
string sqlCommand = "Select...";
DBCommandWrapper dbCommandWrapper =
db.GetSqlStringCommandWrapper(sqlCommand);
ds = db.ExecuteDataSet(dbCommandWrapper);

Any ideas??? Thank you in advance.


Nov 17 '05 #3

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

Similar topics

3
by: Pete Davis | last post by:
I've got the following code: try { reader = new StreamReader(configFile); XmlSerializer serializer = new XmlSerializer(typeof(ServerConfig)); config = (ServerConfig)...
2
by: Dominik | last post by:
After going productive a few days ago, we had a very strange exception on of our loadbalanced productive servers running a Microsoft Content Management Server ASP.Net application. As this exception...
0
by: jeremy | last post by:
I'm running an ASP.Net application in a Windows 2003 Enterprise Server environment. I compiled and debugged the web app on our test server and then deployed it to the production server. The web...
2
by: Adrian Burka | last post by:
HELP! I have written a web service, and a program in C# using Microsoft Visual C#.NET to interact with the web service. Exception handling isn't working in my application, though. One function...
7
by: illegal.prime | last post by:
Hi all, I've got a client/server application and just wanted to ensure that this is expected behavior. I recently set the following configuration in Visual Studio: Debug->Exceptions->Break Into...
3
by: GS | last post by:
why am i getting A first chance exception of type 'System.NullReferenceException' occurred in myapp.exe below? and what can i do get rid of it? Private Function getPrefxType() As String If...
1
by: bg_ie | last post by:
Hi, I like to develope an application which uses a MsSQL database. I believe that C# works really well with MsSQL. To start with, I'd like to host the sql server locally on my machine as I...
0
by: harshal.borade | last post by:
I am using XmlSerializer with XmlAttributeOverrides. The XmlAttributeOverrides are used for properties which hold element/s derived from "AbstractMessage" type. ...
6
by: zubair1 | last post by:
Hi, Today, i added some new code which was to see if a file is locked or not (in use by another application). While i did that it was showing me some errors like in the Output window:- A first...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...

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.