472,805 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

After 2003 to 2005 Upgrade Wizard, Getting System.Security.SecurityException

microsoft.public.dotnet.languages.vb.upgrade isn't getting much
traffic, so I'll try here.

Ours is a VB6 shop exploring .NET.

First I wrote a new application with VB .NET 2003 to create a pdf
Crystal Report from a SQL Server 2000 table. I followed advice from
the MSDN article "Add Professional Quality Reports to Your Application
with Visual Studio .NET"
(http://msdn.microsoft.com/msdnmag/is...2/05/Crystal/), and it
worked fine.

Then we got in VB .NET 2005, and I tried to open this solution
there, with the idea of deploying it as our first .NET server app in a
few days. The Wizard seemed to take it from 2003 to 2005 with no
problem, and I get a clean build. However, when I run, I can't connect
to the test SQL Server I've been using even though I am an
administrator.

Here's the code:

Friend WithEvents scnSQLConnection As _
System.Data.SqlClient.SqlConnection
Friend WithEvents sdaDataAdapter As _
System.Data.SqlClient.SqlDataAdapter
Friend WithEvents ndsMain As MySolutionName.MyDatasetClassName
.. . .
Public Sub FrmThatHasCrystalViewer_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
scnSQLConnection.ConnectionString = _
"Persist Security Info=False;Integrated Security=SSPI;database=" & _
"MyDatabase;server=OurTestSQLServer2000"
sdaDataAdapter.Fill(ndsMain)

It fails on the line above and, in the immediate window, I get:

A first chance exception of type 'System.Security.SecurityException'
occurred in System.Data.dll

When I click on view detail, I get:

System.Security.SecurityException was unhandled
Message="Request for the permission of type
'System.Data.SqlClient.SqlClientPermission,
System.Data, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' failed."
Source="mscorlib" . . .

The dialog box suggests clicking on "Add Permission to the Project." I
did that, and get a dialog box saying "The new permission has been
added to your application. However, the change will not take effect
until the debugging session is restarted."

Restart the debugging session, same problem again. Go all the way of
VS and back in again, still same problem. Reboot, same problem.

I could deploy the VS 2003 build, but it would be nice to start off
with a consistent current version inventory, not to mention that I
would like to understand more.

All ideas and suggestions will be appreciated.

Steve Eisenberg
Pennsylvania U.S.A.

Apr 9 '06 #1
1 1565
Hi,

I have heard of people having problems connecting to sql server 2000
with vb express. The work around is to use the oledb classes instead of the
sqlclient classes. There are example connection strings on
connectionstrings.com

http://www.connectionstrings.com/

Ken
-------------------

"ei****@gmail.com" wrote:
microsoft.public.dotnet.languages.vb.upgrade isn't getting much
traffic, so I'll try here.

Ours is a VB6 shop exploring .NET.

First I wrote a new application with VB .NET 2003 to create a pdf
Crystal Report from a SQL Server 2000 table. I followed advice from
the MSDN article "Add Professional Quality Reports to Your Application
with Visual Studio .NET"
(http://msdn.microsoft.com/msdnmag/is...2/05/Crystal/), and it
worked fine.

Then we got in VB .NET 2005, and I tried to open this solution
there, with the idea of deploying it as our first .NET server app in a
few days. The Wizard seemed to take it from 2003 to 2005 with no
problem, and I get a clean build. However, when I run, I can't connect
to the test SQL Server I've been using even though I am an
administrator.

Here's the code:

Friend WithEvents scnSQLConnection As _
System.Data.SqlClient.SqlConnection
Friend WithEvents sdaDataAdapter As _
System.Data.SqlClient.SqlDataAdapter
Friend WithEvents ndsMain As MySolutionName.MyDatasetClassName
.. . .
Public Sub FrmThatHasCrystalViewer_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
scnSQLConnection.ConnectionString = _
"Persist Security Info=False;Integrated Security=SSPI;database=" & _
"MyDatabase;server=OurTestSQLServer2000"
sdaDataAdapter.Fill(ndsMain)

It fails on the line above and, in the immediate window, I get:

A first chance exception of type 'System.Security.SecurityException'
occurred in System.Data.dll

When I click on view detail, I get:

System.Security.SecurityException was unhandled
Message="Request for the permission of type
'System.Data.SqlClient.SqlClientPermission,
System.Data, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' failed."
Source="mscorlib" . . .

The dialog box suggests clicking on "Add Permission to the Project." I
did that, and get a dialog box saying "The new permission has been
added to your application. However, the change will not take effect
until the debugging session is restarted."

Restart the debugging session, same problem again. Go all the way of
VS and back in again, still same problem. Reboot, same problem.

I could deploy the VS 2003 build, but it would be nice to start off
with a consistent current version inventory, not to mention that I
would like to understand more.

All ideas and suggestions will be appreciated.

Steve Eisenberg
Pennsylvania U.S.A.

Apr 9 '06 #2

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

Similar topics

1
by: Sam | last post by:
I have a desktop VB.Net application I developed locally. I uploaded it to a file server we have and the .Net Framework is installed on the file server. When I try to run the executable from the...
4
by: Steven | last post by:
I just downloaded the June 2005 release and I want to set up basic logging to log problems such as exceptions. I have created a category named Exceptions with the following: <category...
7
by: Abdul-Wahid Paterson | last post by:
Hi, I have had a site working for the last 2 years and have had no problems until at the weekend I replace my database server with a newer one. The database migration went like a dream and I had...
6
by: Joseph Geretz | last post by:
I recently upgraded my server to Windows 2003. The first thing I noticed is that my sample WebService pages no longer worked. The Invoke test button is missing. This is addresed by the following KB...
0
by: David Hodges | last post by:
After installing the service packs from Framework 1.0 and 1.1 on my W2k web server I get the above error on all applications. I am at my wits end and finding nothing on Google that helps. Here...
1
by: musosdev | last post by:
Hi I've got a project I've just run through the conversion wizard, and it's giving me a few headaches. I've got a user control which has controls referrenced from its calling page...
52
by: Neil | last post by:
We are running an Access 2000 MDB with a SQL 7 back end. Our network guy is upgrading to Windows Server 2003 and wants to upgrade Office and SQL Server at the same time. We're moving to SQL Server...
0
by: SMichal | last post by:
Hi, I've got a simple problem when I try to start a new process from my application. I'm starting a new process like this: Process proc = new Process(); proc.StartInfo.Arguments = "";...
0
by: Siberwulf | last post by:
I'm trying to fetch an XML document from a website through an assembly i built and attached to SQL 2005. Here is my code for the SPROC assembly: public static void fetch_FeedData(string...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.