468,321 Members | 1,832 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,321 developers. It's quick & easy.

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 3174

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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Ricardo Luceac | last post: by
11 posts views Thread by RickHodder | last post: by
2 posts views Thread by Andrew | last post: by
20 posts views Thread by Author | last post: by
3 posts views Thread by =?Utf-8?B?SnVsaWEgQg==?= | last post: by
1 post views Thread by howard w | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.