473,216 Members | 1,506 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,216 software developers and data experts.

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.TypeInitializationException: The type initializer for
'System.Data.SqlClient.SqlConnection' threw an exception. --->
System.TypeInitializationException: The type initializer for
'System.Data.SqlClient.SqlConnectionFactory' threw an exception. --->
System.TypeInitializationException: The type initializer for
'System.Data.SqlClient.SqlPerformanceCounters' threw an exception. --->
System.PlatformNotSupportedException: This operation is only supported
on Windows 2000 SP3 or later operating systems.
at
System.Security.Principal.SecurityIdentifier..ctor (WellKnownSidType
sidType, SecurityIdentifier 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 3370

This seems like a pretty clear error message...
>System.PlatformNotSupportedException: 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:
SqlConnection cn = new SqlConnection();

The error is:
System.TypeInitializationException: The type initializer for
'System.Data.SqlClient.SqlConnection' threw an exception. --->
System.TypeInitializationException: The type initializer for
'System.Data.SqlClient.SqlConnectionFactory' threw an exception. --->
System.TypeInitializationException: The type initializer for
'System.Data.SqlClient.SqlPerformanceCounters' threw an exception. --->
System.PlatformNotSupportedException: This operation is only supported
on Windows 2000 SP3 or later operating systems.
at
System.Security.Principal.SecurityIdentifier..cto r(WellKnownSidType
sidType, SecurityIdentifier 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********@nomail.comwrote in message
news:ek********************************@4ax.com...
>
This seems like a pretty clear error message...
>>System.PlatformNotSupportedException: 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:
SqlConnection cn = new SqlConnection();

The error is:
System.TypeInitializationException: The type initializer for
'System.Data.SqlClient.SqlConnection' threw an exception. --->
System.TypeInitializationException: The type initializer for
'System.Data.SqlClient.SqlConnectionFactory' threw an exception. --->
System.TypeInitializationException: The type initializer for
'System.Data.SqlClient.SqlPerformanceCounters' threw an exception. --->
System.PlatformNotSupportedException: This operation is only supported
on Windows 2000 SP3 or later operating systems.
at
System.Security.Principal.SecurityIdentifier..ct or(WellKnownSidType
sidType, SecurityIdentifier 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
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
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...
3
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...
11
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
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...
5
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...
20
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...
3
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
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

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.