473,657 Members | 2,489 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error at constructor for SqlConnection

My program is giving a strange exception at startup, only on client
machines. Runs fine on development machine. The app was upgraded long
ago from a 2003 version to a VS2005 version, but continued to run fine
until just a couple of weeks ago. Now new builds give the error when
the code hits:
SqlConnection cn = new SqlConnection() ;

The error is:
System.TypeInit ializationExcep tion: The type initializer for
'System.Data.Sq lClient.SqlConn ection' threw an exception. --->
System.TypeInit ializationExcep tion: The type initializer for
'System.Data.Sq lClient.SqlConn ectionFactory' threw an exception. --->
System.TypeInit ializationExcep tion: The type initializer for
'System.Data.Sq lClient.SqlPerf ormanceCounters ' threw an exception. --->
System.Platform NotSupportedExc eption: This operation is only supported
on Windows 2000 SP3 or later operating systems.
at
System.Security .Principal.Secu rityIdentifier. .ctor(WellKnown SidType
sidType, SecurityIdentif ier domainSid)....

If the new connection was generated at the form's class level, it would
crash before even tring to load the form, it's only by moving the
constructor to the form's Load procedure that I could see this error
code explicitly. I've tried various things to make sure the references
are correct, and the code and references all seem similar to me to
other programs that run fine on the same clients.

Anybody have more info on this?

Bob Graham

Jan 9 '07 #1
2 3395

This seems like a pretty clear error message...
>System.Platfor mNotSupportedEx ception: This operation is only supported
on Windows 2000 SP3 or later operating systems.
what are your clients running?

Sam

------------------------------------------------------------
We're hiring! B-Line Medical is seeking Mid/Sr. .NET
Developers for exciting positions in medical product
development in MD/DC. Work with a variety of technologies
in a relaxed team environment. See ads on Dice.com.

On 9 Jan 2007 11:17:51 -0800, "RvGrah"
<rv************ ****@sbcglobal. netwrote:
>My program is giving a strange exception at startup, only on client
machines. Runs fine on development machine. The app was upgraded long
ago from a 2003 version to a VS2005 version, but continued to run fine
until just a couple of weeks ago. Now new builds give the error when
the code hits:
SqlConnectio n cn = new SqlConnection() ;

The error is:
System.TypeIni tializationExce ption: The type initializer for
'System.Data.S qlClient.SqlCon nection' threw an exception. --->
System.TypeIni tializationExce ption: The type initializer for
'System.Data.S qlClient.SqlCon nectionFactory' threw an exception. --->
System.TypeIni tializationExce ption: The type initializer for
'System.Data.S qlClient.SqlPer formanceCounter s' threw an exception. --->
System.Platfor mNotSupportedEx ception: This operation is only supported
on Windows 2000 SP3 or later operating systems.
at
System.Securit y.Principal.Sec urityIdentifier ..ctor(WellKnow nSidType
sidType, SecurityIdentif ier domainSid)....

If the new connection was generated at the form's class level, it would
crash before even tring to load the form, it's only by moving the
constructor to the form's Load procedure that I could see this error
code explicitly. I've tried various things to make sure the references
are correct, and the code and references all seem similar to me to
other programs that run fine on the same clients.

Anybody have more info on this?

Bob Graham
Jan 9 '07 #2
The client machines are all XP Pro SP2!!!

Not the issue at all, the error message is misleading. I should probably
have mentioned that I included it for informational purposes for any that
may have experienced the same situation. I believe it has something to do
with having been upgraded from a .net 1.1 app a long time ago, I just have
no clue as to why the builds from this code base would only now start
causing errors on client machines when I upgraded the code almost a year
ago...

Bob
"Samuel R. Neff" <sa********@nom ail.comwrote in message
news:ek******** *************** *********@4ax.c om...
>
This seems like a pretty clear error message...
>>System.Platfo rmNotSupportedE xception: This operation is only supported
on Windows 2000 SP3 or later operating systems.

what are your clients running?

Sam

------------------------------------------------------------
We're hiring! B-Line Medical is seeking Mid/Sr. .NET
Developers for exciting positions in medical product
development in MD/DC. Work with a variety of technologies
in a relaxed team environment. See ads on Dice.com.

On 9 Jan 2007 11:17:51 -0800, "RvGrah"
<rv************ ****@sbcglobal. netwrote:
>>My program is giving a strange exception at startup, only on client
machines. Runs fine on development machine. The app was upgraded long
ago from a 2003 version to a VS2005 version, but continued to run fine
until just a couple of weeks ago. Now new builds give the error when
the code hits:
SqlConnecti on cn = new SqlConnection() ;

The error is:
System.TypeIn itializationExc eption: The type initializer for
'System.Data. SqlClient.SqlCo nnection' threw an exception. --->
System.TypeIn itializationExc eption: The type initializer for
'System.Data. SqlClient.SqlCo nnectionFactory ' threw an exception. --->
System.TypeIn itializationExc eption: The type initializer for
'System.Data. SqlClient.SqlPe rformanceCounte rs' threw an exception. --->
System.Platfo rmNotSupportedE xception: This operation is only supported
on Windows 2000 SP3 or later operating systems.
at
System.Securi ty.Principal.Se curityIdentifie r..ctor(WellKno wnSidType
sidType, SecurityIdentif ier domainSid)....

If the new connection was generated at the form's class level, it would
crash before even tring to load the form, it's only by moving the
constructor to the form's Load procedure that I could see this error
code explicitly. I've tried various things to make sure the references
are correct, and the code and references all seem similar to me to
other programs that run fine on the same clients.

Anybody have more info on this?

Bob Graham

Jan 9 '07 #3

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

Similar topics

12
4119
by: Jose Fernandez | last post by:
Hello. I'm building a web service and I get this error. NEWS.News.CoverNews(string)': not all code paths return a value This is the WebMethod public SqlDataReader CoverNews(string Sport) {
3
1161
by: Ricardo Luceac | last post by:
HI... I have a web page that pass aa context to another.. The second page receives the context and need to put the value of the context into a sql table.. The value is passing ok, 'cause i have a label that print the value, and it's alright... I pass the context value to a variable and try to imput it on the table
3
2576
by: Arnold | last post by:
I am having problem loading the image from the database. It gives this error: "Invalid parameter used." This is my source code: Private abyt() As Byte Private fo As New OpenFileDialog Private sf As New SaveFileDialog Dim strCn As String = "Data Source=DATABASE\BARCA;" & _ "Initial Catalog=MIS;Integrated Security=SSPI" Dim cn As SqlConnection = New SqlConnection(strCn) Dim fs As IO.FileStream
11
2404
by: RickHodder | last post by:
I'm having a problem, and here is a simplified example of code that demonstrates it: public class BizObj { public string TableName=""; private DataSet oData; public BizObj()
2
8124
by: Andrew | last post by:
Win2k3 IIS6 ..NET 2.0 In my ASP.NET 2.0 app I create an open an SQL connection in the page's constructor and call objSQL.Dispose() in the destructor. The SQLConnection object is a class member of the page. Here's the destructor code: /// Destructor ~Officer()
5
3542
by: Cirene | last post by:
I just deployed my new ASP.NET (3.5 FW) site to the hosting company I'm using, webhost4life. NOTE: I HAVE deployed other SQL Server sites to the same account with no issues. Now I'm getting this error. Any idea why? Server Error in '/myuser4/MyWebApp' Application. --------------------------------------------------------------------------------
20
5591
by: Author | last post by:
a .net 1.1 app has a class whose constructor opens a db connection to sql svr two thousand. this class has more than a dozen of methods. most of them don't do db stuff. I am wondering if this design is going to be a problem, bcoz each time this class is instantiated, a db conn is open. The worst thing is that I haven't seen anywhere in the code the db conn is closed. I write about this bcoz I see that this app leaves more than one...
3
1579
by: =?Utf-8?B?SnVsaWEgQg==?= | last post by:
Solved it. I had to rewrite my classes in my business & datalayer changing their constructors. Julia "Julia B" wrote:
0
8392
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
8823
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
8726
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...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8603
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7320
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
6163
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
4151
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...
2
1604
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.